Vite How can I bundle all Javascript files in a single file like webpack.mix?

5.5k Views Asked by At

Vite How can I bundle all Javascript files in a single file like webpack.mix?

When I run Vite Build it creates a file for each component.

That said, what is the correct config to avoid many http requests?

I was expecting to generate only one JS file like Webpack Mix but it didn't work as expected.

1

There are 1 best solutions below

0
On

I managed to fix it with this package https://github.com/richardtallent/vite-plugin-singlefile