Ivan Kopeykin

Results 239 comments of Ivan Kopeykin

> Shall we consider this a limitation of webpack 5 for now yes..

hm.. strange in your example for main.js should be `document.currentScript.src`, but yes `else` case could be improved..

we discussed this internally so.. supporting promises on webpack side would require huge code transformation, that webpack in current version can not perform. There is a [PR](https://github.com/webpack/webpack/pull/15612) to add warning...

we didn't plan this yet.

you should define `__filename`, `__dirname` yourself (like in code above) and right now there is 2 options: - disable import meta parsing `javascript.parser.importMeta=false`. this will keep `import.meta.url` in source code....

@fregante depending on what result you want: - webpack can evaluate `__dirname` , `__filename` - webpack can change them to `fileURLToPath(import.meta.url)` ( PR with this feature is not merged )

> This issue is not about import.meta, it's about being able to import CJS files from ESM just like Node does. Node.js disallow this ```bash $ node index.mjs [14:56:01] index.mjs:1...

please create small reproducible repo, thanks

> Are you saying worker field is checked before browser when the target is webworker? you can prioritize this in resolve options https://webpack.js.org/configuration/resolve/#resolvealiasfields