Skip to content

Conversation

@kuddl
Copy link

@kuddl kuddl commented Aug 10, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: link tbd.
  • Tests for the changes have been added (for bug fixes / features) -> need to add more tests!
  • 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

Tobias Sailer added 2 commits August 13, 2021 15:42
…t default module to CommonJS

Update of file-loader and url-loader introduced the default module import is set to ES module, we
set the config back to commonJS
…nfiguration to enable ESModules

Add a option to make the switch between CommonJS and ES module type imports
@kuddl kuddl force-pushed the feature/ConfigurableESModules branch from 352e3da to 98a9647 Compare August 13, 2021 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants