You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be an issue with module_resolution=node when using .mjs files.
In my sample project I am unable to get Closure to resolve relative short hand module imports like ../internal to ../internal/index.mjs. As far as I understand, this should be a standard node resolution operation where index is implied if internal is a folder.
If this was my own code I would just change the import to use the long hand notation, but this happens in a third party library (Svelte). As a workaround I have created a SED script for manually rewriting the imports, but it would be great if these types of imports were resolved. Bundlers like Rollup resolve them just fine.
There appears to be an issue with
module_resolution=node
when using .mjs files.In my sample project I am unable to get Closure to resolve relative short hand module imports like
../internal
to../internal/index.mjs
. As far as I understand, this should be a standard node resolution operation whereindex
is implied if internal is a folder.If this was my own code I would just change the import to use the long hand notation, but this happens in a third party library (Svelte). As a workaround I have created a SED script for manually rewriting the imports, but it would be great if these types of imports were resolved. Bundlers like Rollup resolve them just fine.
Including relevant parts of my flag file below:
I have a repro of this in my project here: https://github.com/thelgevold/svelte-closure-sample.
Skipping to run the rewrite script (resplace.sh) will reproduce the problem.
Version of Closure: "google-closure-compiler": "20200719.0.0" (npm)
The text was updated successfully, but these errors were encountered: