diff --git a/docs/guide/build.md b/docs/guide/build.md index e08946a8435f81..8fbefcec60c697 100644 --- a/docs/guide/build.md +++ b/docs/guide/build.md @@ -214,7 +214,7 @@ Or, if exposing multiple entry points: } ``` -::: tip Note +::: tip File Extensions If the `package.json` does not contain `"type": "module"`, Vite will generate different file extensions for Node.js compatibility. `.js` will become `.mjs` and `.cjs` will become `.js`. ::: @@ -222,6 +222,10 @@ If the `package.json` does not contain `"type": "module"`, Vite will generate di In library mode, all `import.meta.env.*` usage are statically replaced when building for production. However, `process.env.*` usage are not, so that consumers of your library can dynamically change it. If this is undesirable, you can use `define: { 'process.env.NODE_ENV': '"production"' }` for example to statically replace them. ::: +::: warning Advanced Usage +Library mode includes a simple and opinionated configuration for browser-oriented and JS framework libraries. If you are building non-browser libraries, or require advanced build flows, you can use [Rollup](https://rollupjs.org) or [esbuild](https://esbuild.github.io) directly. +::: + ## Advanced Base Options ::: warning