Webpack seems to be getting plenty of lip service these days. Doubly so in the React community which means most of Facebook. Since Rails leans so heavily on the asset pipeline, how can we merge ES6, modules, and other bits of Webpack greatness with the age old, do one thing well: Sprockets
The following two scripts (one used for Development, the other Production), show that Webpack can easily integrate with Rail's existing asset pipeline. While giving way to utilizing many of the best features hidden in Webpack.
A few caveats about running these scripts:
./client
folder,
top level in your Rails app.javascript_include_tags
wrapped in Rails.env
$(npm bin)/webpack-dev-server --config webpack.config.js --hot --progress --inline --display-chunks
$(npm bin)/webpack --config webpack.production.js
That's it!