Pass optimizeDeps.include to silence build warning (#3507)

* fix(build): pass `optimizeDeps.include` to silence build warning

* chore: add changeset
This commit is contained in:
Nate Moore 2022-06-02 13:03:59 -05:00 committed by GitHub
parent d41540cc77
commit cf2fb3004e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Silence noisy build warnings about `optimizeDeps.include`

View file

@ -152,6 +152,10 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
logLevel: opts.viteConfig.logLevel ?? 'error',
mode: 'production',
css: viteConfig.css,
optimizeDeps: {
include: [...(viteConfig.optimizeDeps?.include ?? [])],
exclude: [...(viteConfig.optimizeDeps?.exclude ?? [])]
},
build: {
...viteConfig.build,
emptyOutDir: false,
@ -234,6 +238,10 @@ async function clientBuild(
logLevel: 'info',
mode: 'production',
css: viteConfig.css,
optimizeDeps: {
include: [...(viteConfig.optimizeDeps?.include ?? [])],
exclude: [...(viteConfig.optimizeDeps?.exclude ?? [])]
},
build: {
emptyOutDir: false,
minify: 'esbuild',