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 |
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 <[email protected]>
Problem
Current webpack 5 evaluates
import.meta.urltofile://some/path/to/sourceof the build machine.Fixes #14445
Proposed changes
add new parser setting
importMeta- enable/disableimport.metaparsingDoes this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
New parser.javascript option
importMeta- enable/disableimport.metaparsing