0.1.0 • Published 7 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 thetsconfig.jsonfile used for the project.
Optional
context: Provide a context for the TypeScript file paths. This is useful if yourtsconfig.jsonandbabel.config.jsare not in the same location.
0.1.0
7 years ago