Open tarhunakau opened 6 years ago
Could you elaborate a bit? If you mean that you've tried ejecting and modifiying the resolve
field, I'm not necessarily sure whether that's something we can control.
@BLRplex I'm not sure if this helps, but I've updated my module resolution to allow "root-relative" imports using a combination of create-react-app
s NODE_PATH
environment variable and TypeScript's paths
setting in .tsconfig
.
The paths
setting may let you do what you're after with aliases?
I have solved issue by ejecting kit. NODE_PATH does not help for tests. It helps with imports for building app, but does not help for running tests. I also have tried to put additional settings in package.json, but you have allowed only 4 properties for overriding. The necessary one is banned. So, the issue is not actual for me anymore. After ejecting config I have put all changes in configs. And it works for me.
@BLRplex Is this currently possible without ejecting?
I use this kind of solution in tsconfig.json
:
"compilerOptions": {
...
"baseUrl": "./src",
"paths": {
"custom_modules": ["./src/mymodules"]
}
}
And for tests I added to .env
-file in the package.json level the following:
NODE_PATH=src
Hopefully this helps.
Hi, there is issue with aliases... I have tried to find a solution but still no luck. Could you please inplement ability to make path aliases for webpack? The full chain of resolving should be for TSLint, code imports and tests both...