You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rollup-plugin-tsconfig-paths

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-tsconfig-paths

Rollup plugin for resolving tsconfig paths

1.5.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

rollup-plugin-tsconfig-paths

Latest Version

Rollup plugin for resolving tsconfig paths

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

rollup.config.js


import tsConfigPaths from "rollup-plugin-tsconfig-paths"
import nodeResolve from "@rollup/plugin-node-resolve"
import commonjs from "@rollup/plugin-commonjs"

export default {
  plugins: [
    tsConfigPaths(),
    nodeResolve({ extensions: [".tsx", ".ts", ".jsx", ".js", ".json", ...] }),
    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 | 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 ("none" | "error" | "warn" | "info" | "debug" | "trace") (default: "info")

Log level when the plugin is running.

reference

Keywords

rollup

FAQs

Package last updated on 23 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts