New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ECMAScript loader (with "type": "module") #13233
Comments
Yep good idea to continue on that. You need to look into the NormalModuleFactory in webpack. It resolves an array of loaders in some method and creates the argument that is later passed to loader-runner. The resolver will provide you the information from package.json and you need to include that as type for the loader-runner argument. |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Bump |
hi, in your comment in #13233 (comment) did you mean this: |
@stefanprobst I tested your patch in some of my projects and everything works fine, maybe you are interested in creating a PR for this, desperately waiting for that |
@otakustay cool, thanks for testing! i opened #15198 to get some maintainer feedback! |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
Yeah, we will fix it soon, just need some time |
Feature request
What is the expected behavior?
If a loader is authored as an ECMAScript module (or if the nearest
package.json
has"type": "module"
), it would be nice if webpack provided the necessary info toloader-runner
so that the loader could be loaded.What is motivation or use case for adding/changing the behavior?
It looks like
loader-runner
supports loaders authored with ESM (see webpack/loader-runner#40). I'm assuming that means that webpack will eventually support ESM loaders. I'm opening this issue to get confirmation on that or to hear if anybody has looked into it.How should this be implemented in your opinion?
If a loader's
package.json
has"type": "module"
, webpack should set theloader.type
tomodule
forloader-runner
.Are you willing to work on this yourself?
Sure (with guidance).
The text was updated successfully, but these errors were encountered: