0.1.0 • Published 5 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 -D
Usage
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.json
file used for the project.
Optional
context
: Provide a context for the TypeScript file paths. This is useful if yourtsconfig.json
andbabel.config.js
are not in the same location.
0.1.0
5 years ago