Created by: sheepsteak
Adds support for compilerOptions.paths in both tsconfig.json and jsconfig.json so that path mapping can be used:
"compilerOptions": {
"baseUrl": "src",
"paths": {
"base/*": ["./components/base/*"],
"pages/*": ["./components/pages/*"],
"actions/*": ["./state/actions/*"]
}
}
-
Parse paths and add to Jest aliases -
Parse paths and add to Webpack aliases -
Show error when pathsis used withoutbaseUrlfor TypeScript before 4.1 -
Show error when pathsis used improperly (has to be like example above with only one possible location; no extra fallbacks as Webpack 4 can't handle it) -
Add docs
I've tried different combinations of paths in both JavaScript and TypeScript projects but no doubt there are still some bugs. I'd just like to get some early feedback and find out what the appropriate level of testing is.
Closes #5645 Closes #9406 Closes #9999 (closed)