-
I found that vite bundles all dependencies into one file when building a library, but why should we do that since the lib and its dependencies are bundled in the final project? Also, the bundled lib can't share the project's dependencies, doesn't it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That might not be intuitive, but that's somewhat known convention and it's required to set
In rollup, people commonly reuse vite/packages/vite/rollup.config.ts Lines 115 to 116 in 56a86ae |
Beta Was this translation helpful? Give feedback.
That might not be intuitive, but that's somewhat known convention and it's required to set
rollupOptions.external
manually. See the doc saying https://vite.dev/guide/build.html#library-modeIn rollup, people commonly reuse
package.json
'sdependencies
as external such asvite/packages/vite/rollup.config.ts
Lines 115 to 116 in 56a86ae