diff options
author | 2022-09-20 20:12:13 +0800 | |
---|---|---|
committer | 2022-09-20 08:12:13 -0400 | |
commit | be9eaa069287d16ac8efc69e13407a5dfa5e5808 (patch) | |
tree | 53b8ec0c0a609f6f9579b9a293777044cb07e5d5 | |
parent | 44fa378186d711f8efab2135247ffde980e94795 (diff) | |
download | astro-be9eaa069287d16ac8efc69e13407a5dfa5e5808.tar.gz astro-be9eaa069287d16ac8efc69e13407a5dfa5e5808.tar.zst astro-be9eaa069287d16ac8efc69e13407a5dfa5e5808.zip |
Allow override `vite.build.target` (#4813)
-rw-r--r-- | .changeset/green-baboons-clean.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/build/static-build.ts | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/.changeset/green-baboons-clean.md b/.changeset/green-baboons-clean.md new file mode 100644 index 000000000..ebdd5f8c7 --- /dev/null +++ b/.changeset/green-baboons-clean.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Allow override `vite.build.target` diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index dfaad12bd..d7b9d5026 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -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, @@ -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, @@ -197,6 +196,7 @@ async function clientBuild( logLevel: 'info', mode: 'production', build: { + target: 'esnext', ...viteConfig.build, emptyOutDir: false, minify: 'esbuild', @@ -213,7 +213,6 @@ async function clientBuild( }, preserveEntrySignatures: 'exports-only', }, - target: 'esnext', // must match an esbuild target }, plugins: [ vitePluginInternals(input, internals), |