Bjorn Lu

Results 767 comments of Bjorn Lu

Perhaps it makes sense to cut a breaking minor for now to resolve this. I haven't got the time to do a better overhaul.

I looked into bumping this today and it looks like it also requires `@npmcli/arborist` to be used along-side, and unfortunately it's extremely large. [162 dependencies](https://npmgraph.js.org/?q=%40npmcli%2Farborist) and [13.5MB total install size](https://packagephobia.com/result?p=%40npmcli%2Farborist)....

> Changing this [line](https://github.com/vitejs/vite/blob/2492e23ab816a1c51dd8d2a4ab772168b68689cd/packages/vite/src/node/plugins/esbuild.ts#L182) from `esnext` to `es2020` does resolve the problem. The configuration for that line is through the `esbuild.target` config for your source code. The `optimizeDeps.esbuildOptions` config is...

@newcat `build.target` should only affect the build as its name suggest. For dev, the goal is to only transpile to normal JS as serve it as-is. E.g. if you're writing...

That's how Vite works fundamentally (even before I started maintaining it). Dev and build are two separate paths, and while we try to keep things consistent between them, dev has...

`optimizeDeps.esbuildOptions.target` would be the config option as the dependencies are optimized by esbuild. Polyfills etc are not supported in dev. Dev usually needs a more modern browser if not evergreen...

Yes that would be the way, however it may be bring a slower development loop depending on your project size. It's a tradeoff Vite makes for the DX side of...

You can set `esbuild.target: "es2020"` or `esbuild.supported.decorators: false` (see https://github.com/vitejs/vite/issues/17308) to get it to work. If you want to use decorators in JS too, you need to configure esbuild to...

Seems like it's because Vite expects the module script to always be in the head and not moved to the body. We could make sure if it's moved we still...

From your system info, I think you're hitting a chrome bug: - https://x.com/antfu7/status/1836846357489012816 - https://github.com/antfu/repro-chrome-v129