webpack-config-plugins
webpack-config-plugins copied to clipboard
Feature/configurable es modules
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: link tbd.
- [x] Tests for the changes have been added (for bug fixes / features) -> need to add more tests!
- [x] Docs have been added / updated (for bug fixes / features)
PR Type
[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] tooling / infrastructure changes
[ ] Other... Please describe:
What is the current behavior?
Right now, there is no option to configure the type of import ESModules or CommonJS. Since file-loader 5.0 the default is set to "ESModules". Therefore we needed a way to configure it back to CommonJS.
https://github.com/webpack-contrib/file-loader/releases/tag/v5.0.0
What is the new behavior?
You can configure, if you want to use CommonJS (default) or ESModules (with option set to true)
Does this PR introduce a breaking change?
[ ] Yes
[x] No
Other information
Maybe we could write more test for this behaviour. Right now, the tests, only check, if the option is set correctly
https://github.com/webpack-contrib/file-loader/releases/tag/v5.0.0