Open Vasile-Peste opened 4 years ago
Would require.resolve("#root/your-module")
solve your problem ?
Note, it's for resolving modules rather than files, see this discussion for more info: https://github.com/ilearnio/module-alias/issues/71
@Kehrlann, in commonjs looks good, but how about ES6 import? I'm using Typescript, so in the compilation is src/ and in the runtime is dist/. For example.
@lvfxbr I highly looking into tsconfig-paths for TypeScript code ; rather than have to fiddle around with module-alias
I see that for advanced usage I can require the module and use methods like
addAlias
for adding new aliases.I would like to be able also to resolve an alias. Use case: