load-ts-paths
v0.0.7
Published
load path of tsconfig.js
Downloads
10
Maintainers
Readme
load-ts-paths
Read the paths information defined in tsconfig.json and make it usable in babel-plugin-module-resolver.
install
yarn add -D babel-plugin-module-resolver load-ts-paths
usage
babel.config.js
const {loadTsPaths} = require('load-ts-paths')
module.exports = {
presets: [...],
plugins: [
[
'babel-plugin-module-resolver',
{
root: ['./src'], // baseUrl of tsconfig.json
alias: loadTsPaths('./tsconfig.json'),
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
],
],
}