tsconfig
paths to webpack
aliases
Convert Utility package to convert typescript paths notation to webpack aliases.
Description
Typescript uses globstar in paths
compiler option that is incompatible with webpack alias
property.
This utility function converts paths
found in tsconfig.json
file to notation which webpack understands. In this way typescript
and webpack
aliases are always in sync and there is only one source of truth when it comes to aliases.
Usage
in your webpack.config
const convertPathsToAliases = defaultconst tsconfig = // all comments in tsconfig.json must be removedconst aliases = moduleexports = ... resolve: alias: aliases