Allow override vite.build.target
(#4813)
This commit is contained in:
parent
44fa378186
commit
be9eaa0692
2 changed files with 7 additions and 3 deletions
5
.changeset/green-baboons-clean.md
Normal file
5
.changeset/green-baboons-clean.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Allow override `vite.build.target`
|
|
@ -118,6 +118,7 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
|
||||||
logLevel: opts.viteConfig.logLevel ?? 'error',
|
logLevel: opts.viteConfig.logLevel ?? 'error',
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
build: {
|
build: {
|
||||||
|
target: 'esnext',
|
||||||
...viteConfig.build,
|
...viteConfig.build,
|
||||||
emptyOutDir: false,
|
emptyOutDir: false,
|
||||||
manifest: false,
|
manifest: false,
|
||||||
|
@ -134,8 +135,6 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ssr: true,
|
ssr: true,
|
||||||
// must match an esbuild target
|
|
||||||
target: 'esnext',
|
|
||||||
// improve build performance
|
// improve build performance
|
||||||
minify: false,
|
minify: false,
|
||||||
polyfillModulePreload: false,
|
polyfillModulePreload: false,
|
||||||
|
@ -197,6 +196,7 @@ async function clientBuild(
|
||||||
logLevel: 'info',
|
logLevel: 'info',
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
build: {
|
build: {
|
||||||
|
target: 'esnext',
|
||||||
...viteConfig.build,
|
...viteConfig.build,
|
||||||
emptyOutDir: false,
|
emptyOutDir: false,
|
||||||
minify: 'esbuild',
|
minify: 'esbuild',
|
||||||
|
@ -213,7 +213,6 @@ async function clientBuild(
|
||||||
},
|
},
|
||||||
preserveEntrySignatures: 'exports-only',
|
preserveEntrySignatures: 'exports-only',
|
||||||
},
|
},
|
||||||
target: 'esnext', // must match an esbuild target
|
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vitePluginInternals(input, internals),
|
vitePluginInternals(input, internals),
|
||||||
|
|
Loading…
Reference in a new issue