reactjs - Hvordan konfigurere SVGR i en tsup-pakke inne i en turborepo
Så jeg jobbet på et prosjekt hvor jeg ville sette opp svgr inne i en tsup-pakke i turborepo.
Dette er min tsup-konfig
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,
}));
og dette er mappestrukturen min
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