These changes will allow to work with webpack 5+, which I think should be the new default.
webpack 5 introduced a lot of breaking changes, I just fixed the minimum to pass current test, specially t/example-build-assets.t test.
They are big changes though, and I am not very sure of the full implicances (I am not an expert on webpack, but I have been using it since several months). I have a version running in my computer with these changes and running webpack 5, and seem to work fine, but other than that I can't tell.
There is also a specific guide on webpack site, that can address further needed changes, but I didn't need to follow it because the changes introduced by this PR were enough in my case.
Some breaking changes considered:
I needed to specify @next on html-webpack-plugin, otherwise it install the former version (for webpack 4)
terser-webpack-plugin doesn't support cache nor sourceMap options, so I removed those
optimize-css-assets-webpack-plugin is not supported anymore. I used css-minimizer-webpack-plugin to replace it
contenthash seem to be generated ok without webpack-plugin-hash-output, so I removed it because caused lots of warnings
Quick testing
It can be dificult to migrate from a installed webpack 4 to 5 in the middle of a project, so in my repo there is a branch 'test-container' that can be used as a smoke test if you change anything. Has a minimal Dockerfile to have a perl 5.32 container with npm installed.
These changes will allow to work with webpack 5+, which I think should be the new default.
webpack 5 introduced a lot of breaking changes, I just fixed the minimum to pass current test, specially t/example-build-assets.t test.
They are big changes though, and I am not very sure of the full implicances (I am not an expert on webpack, but I have been using it since several months). I have a version running in my computer with these changes and running webpack 5, and seem to work fine, but other than that I can't tell.
There is also a specific guide on webpack site, that can address further needed changes, but I didn't need to follow it because the changes introduced by this PR were enough in my case.
Some breaking changes considered:
Quick testing
It can be dificult to migrate from a installed webpack 4 to 5 in the middle of a project, so in my repo there is a branch 'test-container' that can be used as a smoke test if you change anything. Has a minimal Dockerfile to have a perl 5.32 container with npm installed.
Just checkout to that branch and run: