I have a component library with 40 or so components in a monorepo using Vue3, Options API, TS building with vite. The issue is that it takes about a minute to build. It looks like the transform step is the bottle necks in vite-plugin-inspect but I don't have the experience to know where to begin in speeding it up.
- The only barrel is in the entry point file with exports each component. When components import another component they are explicit import paths and do not import from the barrel.
- The vite-plugin-inspect is showing large transforms on a few mixins. Sometimes the load-fallback, sometimes the vite:esbuild. The odd thing is that these mixins are small and do anything complex or particularly interesting. They dont import anything, just define some functions. Maybe there's a ts config issue?
Entry point index.ts:
export {A} from @/components/A
export {B} from @/components/B
// ... and so on
// tsconfig
{
"compilerOptions": {
"esModuleInterop": true,
"noImplicitAny": false,
"noImplicitReturns": false,
"strictNullChecks": false,
"noImplicitThis": true,
"module": "es2015",
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"target": "es5",
"baseUrl": ".",
"resolveJsonModule": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"jsx": "preserve",
"sourceMap": true,
"composite": true,
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom"
]
},
"include": [
"./src/**/*"
],
"exclude": [
"node_modules"
],
}