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
Disable compile time evaluation of import.meta.url #15246
Conversation
|
For maintainers only:
|
This options should be implemented on module level, i.e. you can disable it for some modules, example of |
- use it in ImportMetaPlugin to switch it off as necessary
b55db4f
to
73bb431
Compare
Looks good, can you accept CLA? |
Now I tested it that it works for my use case. I also tested that it keeps doing the original substitution by default. |
I think it is lack supported
|
Run |
I guess that something And that only for tests which are for the es6 module target, because things like Could you advise what enumerates the test files? |
- enable/disable import.meta parsing - when disabled insert output.importMetaName
e1f4ad6
to
c09e82f
Compare
@pavelsavara thanks for starting PR, we discussed internally that |
Cool, feel free to take it over. |
not sure, I think syntax error was in vm context that was running without esm enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nitpicks
4714fb5
to
232403c
Compare
I've created an issue to document this in webpack/webpack.js.org. |
I'm affected by webpack/webpack#14445, fixed in webpack/webpack#15246, available in webpack >= [v5.68.0](https://github.com/webpack/webpack/releases/tag/v5.68.0), so I'd love to have an ncc version using webpack >= v5.68.0! Co-authored-by: Steven <steven@ceriously.com>
Problem
Current webpack 5 evaluates
import.meta.url
tofile://some/path/to/source
of the build machine.Fixes #14445
Proposed changes
add new parser setting
importMeta
- enable/disableimport.meta
parsingDoes this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
New parser.javascript option
importMeta
- enable/disableimport.meta
parsing