Skip to content

Commit

Permalink
fix: don't overwrite default options unless given new value (vitejs#5111
Browse files Browse the repository at this point in the history
)
  • Loading branch information
benmccann authored and aleclarson committed Nov 8, 2021
1 parent 5155f64 commit 98e5e5e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/vite/src/node/build.ts
Expand Up @@ -234,16 +234,6 @@ export function resolveBuildOptions(raw?: BuildOptions): ResolvedBuildOptions {
cssCodeSplit: !raw?.lib,
sourcemap: false,
rollupOptions: {},
commonjsOptions: {
include: [/node_modules/],
extensions: ['.js', '.cjs'],
...raw?.commonjsOptions
},
dynamicImportVarsOptions: {
warnOnError: true,
exclude: [/node_modules/],
...raw?.dynamicImportVarsOptions
},
minify: raw?.ssr ? false : 'esbuild',
terserOptions: {},
write: true,
Expand All @@ -256,7 +246,17 @@ export function resolveBuildOptions(raw?: BuildOptions): ResolvedBuildOptions {
// brotliSize: true,
chunkSizeWarningLimit: 500,
watch: null,
...raw
...raw,
commonjsOptions: {
include: [/node_modules/],
extensions: ['.js', '.cjs'],
...raw?.commonjsOptions
},
dynamicImportVarsOptions: {
warnOnError: true,
exclude: [/node_modules/],
...raw?.dynamicImportVarsOptions
}
}

// handle special build targets
Expand Down

0 comments on commit 98e5e5e

Please sign in to comment.