load-ts-paths
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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'],
      },
    ],
  ],
}

Package Sidebar

Install

npm i load-ts-paths

Weekly Downloads

3

Version

0.0.7

License

MIT

Unpacked Size

3.59 kB

Total Files

6

Last publish

Collaborators

  • cljames