Skip to content

Commit

Permalink
build: remove production source map for dist/node
Browse files Browse the repository at this point in the history
Currently the source maps are not even working because we
are not shipping source files in src/node. Removing these
source maps saves ~5mb of installation size.

Tooling authors who need source map for debugging should
clone the Vite repo locally and build it in development
mode.
  • Loading branch information
yyx990803 committed Jan 13, 2022
1 parent cbc633a commit 1c1f82f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/vite/rollup.config.js
Expand Up @@ -71,8 +71,7 @@ const sharedNodeOptions = {
exports: 'named',
format: 'cjs',
externalLiveBindings: false,
freeze: false,
sourcemap: true
freeze: false
},
onwarn(warning, warn) {
// node-resolve complains a lot about this but seems to still work?
Expand Down Expand Up @@ -105,6 +104,10 @@ const createNodeConfig = (isProduction) => {
index: path.resolve(__dirname, 'src/node/index.ts'),
cli: path.resolve(__dirname, 'src/node/cli.ts')
},
output: {
...sharedNodeOptions.output,
sourcemap: !isProduction
},
external: [
'fsevents',
...Object.keys(require('./package.json').dependencies),
Expand Down Expand Up @@ -133,7 +136,8 @@ const createNodeConfig = (isProduction) => {
// in development we need to rely on the rollup ts plugin
...(isProduction
? {
declaration: false
declaration: false,
sourceMap: false
}
: {
declaration: true,
Expand Down

0 comments on commit 1c1f82f

Please sign in to comment.