“package.json contains a local aliasing mechanism for import paths called ‘imports’. It satisfies many use cases without tooling-specific solutions like tsconfig.json.”
https://socket.dev/blog/we-don-t-need-more-path-aliases #JavaScript
package.json
{
"imports": {
"#components": {
"browser": "./src/components/client/*",
"default": "./src/components/server/*"
}
}
}
my-module.js
import '#components/customer-table.js';
📖 Details (in my free online book on Node.js): https://exploringjs.com/nodejs-shell-scripting/ch_packages.html#package-imports
@rauschma To my knowledge, tools don't support this good enough for now