reactjs - วิธีการกำหนดค่า SVGR ในแพ็กเกจ tsup ภายใน turborepo
ดังนั้นฉันกำลังทำงานในโปรเจกต์ที่ฉันอยากตั้งค่า svgr ภายในแพ็กเกจ tsup ใน turborepo
นี่คือการตั้งค่า tsup ของฉัน
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,
}));
และนี่คือโครงสร้างโฟลเดอร์ของฉัน
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