You can continue using Grunt and use to invoke webpack. You will essentially be switching from requirejs to webpack.
Webpack is an evolution over requirejs in a variety of aspects. It has a much more fine-grained plugin system that allows utlities to hook in to various stages of bundling.
The webpack dev-server does in-memory caching of modules and the client receives a compiled bundle (even during development). This is much faster than require's module resolution which happens in browser and loads module files one by one, applying any associated transforms (babel etc.) along the way.
In fact I am surprised by that requirejs did not have a good code splitting solution (atleast in the core) despite the AMD format being so uniquely suitable for it (asynchronous by default).
Starting with Webpack 2, it has native support for ES6 modules with allows for better static analysis and dead code elimination which, though has not been realized to its full extent, allows for a wider scope of optimization during bundling.
Lorefnon
Open Web Enthusiast
You can continue using Grunt and use to invoke webpack. You will essentially be switching from requirejs to webpack.
Webpack is an evolution over requirejs in a variety of aspects. It has a much more fine-grained plugin system that allows utlities to hook in to various stages of bundling.
The webpack dev-server does in-memory caching of modules and the client receives a compiled bundle (even during development). This is much faster than require's module resolution which happens in browser and loads module files one by one, applying any associated transforms (babel etc.) along the way.
Also features like code-splitting and HMR are really great.
In fact I am surprised by that requirejs did not have a good code splitting solution (atleast in the core) despite the AMD format being so uniquely suitable for it (asynchronous by default).
Starting with Webpack 2, it has native support for ES6 modules with allows for better static analysis and dead code elimination which, though has not been realized to its full extent, allows for a wider scope of optimization during bundling.