1.7.1 • Published 3 years ago

rollup-plugin-ts-paths-resolve v1.7.1

Weekly downloads
252
License
MIT
Repository
github
Last release
3 years ago

rollup-plugin-ts-paths-resolve

Latest Version

A rollup plugin for resolving tsconfig-paths

yarn add -D rollup-plugin-ts-paths-resolve

rollup.config.js

import commonjs from "@rollup/plugin-commonjs"
// import nodeResolve from "@rollup/plugin-node-resolve";
import tsPathsResolve from "rollup-plugin-ts-paths-resolve";

export default {
  plugins: [
	// nodeResolve(),
    tsPathsResolve(),
    commonjs(),
  ]
}

Example tsconfig.json

{
  "compilerOptions": {
    "jsx": "preserve",
    "module": "esnext",
    "moduleResolution": "node",
    "target": "esnext",
    "lib": ["esnext", "dom", "dom.iterable"],
    "types": ["react", "webpack-env"],
    "baseUrl": ".",
    "paths": {
      "~/*": ["./*"]
    }
  }
}

Then you can import alias instead of annoying path

// import App from "../../../../App"
import App from "~/App"

...

Options

tsConfigPath (string)

Specify set where your TypeScript configuration file.

If not set:

  • use Environment variable TS_NODE_PROJECT
  • or search tsconfig.json in current working directory.

logLevel ("warn" | "debug" | "none") (default: "warn")

Log level when the plugin is running.

reference

1.7.1

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago