New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
17K
increased by5.91%
Maintainers
1
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc