Skip to content

Commit

Permalink
fix: don't overwrite default options unless given new value (#5111)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Sep 27, 2021
1 parent b2ae627 commit 4d72b40
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 4d72b40

Please sign in to comment.