1.0.5 • Published 4 years ago

rollup-plugin-ts-paths v1.0.5

Weekly downloads
385
License
MIT
Repository
github
Last release
4 years ago

rollup-plugin-ts-paths

Replace alias with resolved import from paths in tsconfig.json. Let's you use rollup to bundle/transpile code generated by tsc like this

// src/path/to/foo/foot.ts
import { Foo } from 'foo';

where foo is defined in tsconfig.json

{
  "compilerOptions": {
      "paths": {
        "foo": [
          "src/path/to/foo/foo.ts"
        ]
      }
  }
}

Installation

npm install --save-dev rollup-plugin-ts-paths

Usage

Generally, you need to ensure that rollup-plugin-ts-paths goes before other things (like rollup-plugin-commonjs) in your plugins array, so that the correc file can be resolved from an import.

// rollup.config.js
import tsConfigPaths from 'rollup-plugin-ts-paths';

export default {
  // ...
  plugins: [
    tsConfigPaths()
  ]
};

Options

{
  // The directory the TS config file can be found in (optional)
  tsConfigDirectory: processs.cwd()
}

Limitations

Currently on the first entry of a path specified in a tsconfig.json is supported.

License

MIT

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago