Tìm kiếm trang web

reactjs - Cách cấu hình SVGR trong một gói tsup bên trong turborepo


Vì vậy, tôi đang làm việc trên một dự án nơi tôi muốn thiết lập svgr bên trong một gói tsup trong turborepo.

Đây là cấu hình tsup của tôi

import type { Options } from "tsup";
import { defineConfig } from "tsup";


export default defineConfig((options: Options) => ({
  plugins: [],
  treeshake: true,
  splitting: true,
  entryPoints: ["./**/*.tsx"],
  // format: ["esm"],
  dts: true,
  minify: true,
  clean: true,
  externals: ["react"],
  ...options,
}));

và đây là cấu trúc thư mục của tôi

my-turborepo-project/
|-- app/
|   |-- web/
|   |-- docs/
|-- packages/
|   |-- ui/
|   |   |-- components/
|   |   |-- tsup.config.ts
|   |   |-- tailwind.config.mjs
|   |   |-- tsconfig.json
|   |-- tailwind-config/
|   |-- tsconfig/
|   |-- eslint-config/
|-- tsconfig.json
|-- turbo.json
|-- pnpm-workspace.yaml
|-- pnpm-lock.yaml
|-- package.json
|-- .gitignore