Javascript ES6 Modules

I have used webpack for a long time to bundle my es6 modules. It works great, uses babel plugin.

You can use Vite as well. It has a lib mode.

The challenge I have faced with Vite is the inability to use commonjs npm modules, but if you are not having such dependencies and using primarily to bundle just your code, it should work great.

Again, you need Vite only if want a dev-server with hmr. Vite uses esbuild underneath, so if you want to just run in watch mode and continuously bundle into a disk location, you could directly use esbuild itself.

Btw, I don’t know about how you integrate with wordpress. Share your experience :smiley: