Skip to content

[WARN] [vite] build.terserOptions -- annoying false warning duiring project build #9341

@genesem

Description

@genesem

Astro Info

Astro                    v4.0.2
Node                     v20.10.0
System                   Windows (x64)
Package Manager          npm -- [email protected] actually.
Output                   static
Adapter                  none
Integrations             @astrojs/vue
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

chrome, etc.

Describe the Bug

Astro build displays incorrect warning:

16:13:21 [**WARN] [vite] build.terserOptions is specified but build.minify is not set to use Terser. Note Vite now defaults to use esbuild for minification. If you still prefer Terser, set build.minify to "terser".**

astro config values are correct and were working fine with prev. version.
they are

...
vite: {
...
build: {
...
minify: "terser",
terserOptions: {
format: {
comments: false,
// safari10: true,
},
// mangle: {
// safari10 : true,
// module: true,
// },
ecma: '2015',
safari10 : true,
},

What's the expected result?

No warning should be displayed as option were set correctly.
minify: "terser", ...

Run 'yarn build' to check it out at repro. provided.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-5sum9v?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions