This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

rollup-plugin-ts-paths-resolve
TypeScript icon, indicating that this package has built-in type declarations

1.7.1 • Public • Published

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

Package Sidebar

Install

npm i rollup-plugin-ts-paths-resolve

Weekly Downloads

312

Version

1.7.1

License

MIT

Unpacked Size

50 kB

Total Files

8

Last publish

Collaborators

  • lightyen