Skip to content

Commit

Permalink
Allow override vite.build.target (#4813)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Sep 20, 2022
1 parent 44fa378 commit be9eaa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-baboons-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Allow override `vite.build.target`
5 changes: 2 additions & 3 deletions packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
logLevel: opts.viteConfig.logLevel ?? 'error',
mode: 'production',
build: {
target: 'esnext',
...viteConfig.build,
emptyOutDir: false,
manifest: false,
Expand All @@ -134,8 +135,6 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
},
},
ssr: true,
// must match an esbuild target
target: 'esnext',
// improve build performance
minify: false,
polyfillModulePreload: false,
Expand Down Expand Up @@ -197,6 +196,7 @@ async function clientBuild(
logLevel: 'info',
mode: 'production',
build: {
target: 'esnext',
...viteConfig.build,
emptyOutDir: false,
minify: 'esbuild',
Expand All @@ -213,7 +213,6 @@ async function clientBuild(
},
preserveEntrySignatures: 'exports-only',
},
target: 'esnext', // must match an esbuild target
},
plugins: [
vitePluginInternals(input, internals),
Expand Down

0 comments on commit be9eaa0

Please sign in to comment.