awesome-typescript-loader
awesome-typescript-loader copied to clipboard
Can't get path aliasing to work with webpack
I actually posted this on stackoverflow but there is no tag for this project.
https://stackoverflow.com/questions/51624134/aliasing-with-webpack-4-and-awesome-typescript-loader-not-working
I'm basically having issues with getting alias to work properly with webpack 4 and awesome typescript loader. It's not clear to me if its the configuration or what.
Any advice appreciated, Thanks, Derek
It seems ATL doesn't handle tsconfig paths where the lhs contains an *
at the moment.
Not working:
"paths": {
"*" : ["types/*"],
"common/*": ["src/stuff/common/"]
}
working fine:
"paths": {
"common": ["src/stuff/common/"]
}
There's three workarounds I've found:
- Rewrite the LHS of the paths so they don't have a
*
in them - but that isn't always possible. - ... add the mappings with asterisks in them to the webpack config manually. Which sort of defeats the purpose of having a plugin for this in the first place.
- Use another plugin to handle path aliasing.
I've had success with the one ts-loader's github README recommends; tsconfig-paths-webpack-plugin (which b.t.w. "uses work done in awesome-typescript-loader").