Is your feature request related to a problem? Please describe.
I tried to use Vite + React + Antd to create a new project锛孉long the way, as more dependency packages were added, I had to deal with whether each dependency package was ESM or not. This process is a bit painful because there are a lot of packages in the community that are not ready for ESM
Describe the solution you'd like
Supported non-ESM by default or enable by config option
Vite construct base on esm, the non-esm is actually not support by default.Other, there are already has way to support non-esm, you can use optimizeDeps: { include: [xxxx] } to pre-bundle non-esm, but it's not recommand, you should ask export esm from package maintainer .
I tried to use Vite + React + Antd to create a new project
You can have a start with https://github.com/vitejs/create-vite-app react preset.
The goal of Vite is not trying to be popular. The goal is to push the ecosystem to use ESM.
Is there more documentation on optimizeDeps?
Is the following terminal output related to optimizeDeps?
[vite] Optimizable dependencies detected:
react-responsive, react-spring
What exactly is meant by "pre-bundling non-ESM"?
Thanks!
Most helpful comment
The goal of Vite is not trying to be popular. The goal is to push the ecosystem to use ESM.