Node import compatibility in the browser #6051
BobFrankston
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's nice that I can use node modules in the browser by using a "./node_modules," but this is not compatible with node's semantics. It would be nice to have an nm: (or other name) prefix that would search for node_modules and resolve using node semantics.
If express supported it, it's more likely to get support in VSC and Node, which could simply ignore it.
The benefit is to greatly facilitate share modules. At least until Deno integration.
no need to know "." versus "..", and index.js names.
The other problem with the current approach it VSC's tendency to create imports deep into the path rather than just the main module.
Note, it is possible to leave out the nm: and just have express test to see if there is a node_module/sample/package.json
Beta Was this translation helpful? Give feedback.
All reactions