rails / jsbundling-rails

Bundle and transpile JavaScript in Rails with esbuild, rollup.js, bun, or Webpack.
MIT License
849 stars 147 forks source link

Webpacker instructions: fix incompatibility with Webpack 5 #109

Closed rstacruz closed 2 years ago

rstacruz commented 2 years ago

This updates the docs to not suggest a Webpack 4 plugin (webpack-fix-style-only-entries) for a Webpack 5 setup.

Background

The webpack-fix-style-only-entries recommended by the guide is not compatible with Webpack 5. Another plugin, webpack-remove-empty-scripts, is a drop-in replacement that works on Webpack 5.

Screenshots

This is what happens with webpack-fix-style-only-entries:

image

This is the notice on the webpack-fix-style-only-entries repo:

image