-
Notifications
You must be signed in to change notification settings - Fork 38
Description
I don't think this is an issue with the current spec but rather a convention in the tooling (but still wanted to discuss about it).
For context, here's the definition of a module import:

We can easily map that into ESM:
moduleis a ES modulenamethe identifier used in the ExportDeclaration of the module.
If the notion of module has the same semantics as ES Module it should be possible to include modules directly from npm as well as local files (or custom rules defined by bundlers).
Here's my issue
When using emscripten (for example) the imports of the wasm modules are using the env or global module, which can't be found using the current bundlers (since they will resolve it to an npm module, note that it's even dangerous).
While there's not reason to prevent using npm modules we should refer to local files first. I can see a few solutions for that problem:
- Bundlers could search for local files before searching on npm.
- Emscripten could use
./envand./globalinstead (impacts manual usage). - Extra linking phase that changes the name of the modules.
"Bundlers" means currently Webpack and Rollup in the future.