0.1.0 • Published 6 years ago
ts-paths-to-babel-alias v0.1.0
ts-paths-to-babel-alias
Convert TypeScript paths to babel alias paths.
Install
yarn add ts-paths-to-babel-alias --dev
or
npm install ts-paths-to-babel-alias -DUsage
In the babel.config.js config add the module to the alias property:
const resolveTSPathsToBabelAlias = require('ts-paths-to-babel-alias')
/* ...babel config */
{
  alias: {
    ...resolveTSPathsToBabelAlias({
      configFile
    }),
  }
}Options
Required
- configFile: The path to the- tsconfig.jsonfile used for the project.
Optional
- context: Provide a context for the TypeScript file paths. This is useful if your- tsconfig.jsonand- babel.config.jsare not in the same location.
0.1.0
6 years ago