All Projects → simonhaenisch → rollup-plugin-typescript-paths

simonhaenisch / rollup-plugin-typescript-paths

Licence: MIT license
Rollup Plugin to automatically resolve path aliases set in the compilerOptions section of tsconfig.json.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to rollup-plugin-typescript-paths

rollup-plugin-purs
Bundles PureScript modules with Rollup
Stars: ✭ 71 (+121.88%)
Mutual labels:  rollup-plugin
vite-plugin-rescript
Integrate ReScript with Vite seamlessly
Stars: ✭ 56 (+75%)
Mutual labels:  rollup-plugin
rollup-plugin-smart-asset
Rollup plugin to rebase, inline or copy assets referenced from the code
Stars: ✭ 32 (+0%)
Mutual labels:  rollup-plugin
svelte-typescript
Typescript monorepo for Svelte v3 (preprocess, template, types)
Stars: ✭ 214 (+568.75%)
Mutual labels:  rollup-plugin
rollup-plugin-stylus-css-modules
A Rollup.js plugin to compile Stylus and inject CSS Modules
Stars: ✭ 15 (-53.12%)
Mutual labels:  rollup-plugin
rollup-plugin-userscript-metablock
Transform json file to userscript metablock and append on.
Stars: ✭ 26 (-18.75%)
Mutual labels:  rollup-plugin
vite-rollup-plugins
A compatibility list of rollup plugins for Vite 2 and test playground
Stars: ✭ 76 (+137.5%)
Mutual labels:  rollup-plugin
rollup-plugin-external-globals
Transform external imports into global variables like output.globals.
Stars: ✭ 57 (+78.13%)
Mutual labels:  rollup-plugin
rollup-plugin-html-entry
Use HTML files as entry points in your rollup bundle.
Stars: ✭ 13 (-59.37%)
Mutual labels:  rollup-plugin
rollup-plugin-html
Import HTML files as strings in rollup build
Stars: ✭ 36 (+12.5%)
Mutual labels:  rollup-plugin
postcss-font-grabber
A postcss plugin, it grabs remote font files and update your CSS, just like that.
Stars: ✭ 26 (-18.75%)
Mutual labels:  rollup-plugin
blurhash-as
Blurhash implementation in AssemblyScript
Stars: ✭ 26 (-18.75%)
Mutual labels:  rollup-plugin
rollup-plugin-inject-process-env
Inject environment variables in process.env with Rollup
Stars: ✭ 48 (+50%)
Mutual labels:  rollup-plugin
rollup-plugin-generate-html-template
Rollup plugin for automatically injecting a script tag with the final bundle into an html file.
Stars: ✭ 58 (+81.25%)
Mutual labels:  rollup-plugin
rollup-plugin-lit-css
Moved to https://github.com/bennypowers/lit-css
Stars: ✭ 35 (+9.38%)
Mutual labels:  rollup-plugin
rollup-plugin-tagged-template
Use plain HTML files as tagged templates.
Stars: ✭ 24 (-25%)
Mutual labels:  rollup-plugin
rollup-plugin-closure-compiler-js
Rollup plugin for optimizing JavaScript with google-closure-compiler-js.
Stars: ✭ 31 (-3.12%)
Mutual labels:  rollup-plugin
rollup-plugin-copy-assets
Copy additional assets into the output directory of your rollup bundle.
Stars: ✭ 25 (-21.87%)
Mutual labels:  rollup-plugin
web-config
A Rollup configuration to build modern web applications with sweet features as for example SCSS imports, Service Worker generation with Workbox, Karma testing, live reloading, coping resources, chunking, treeshaking, Typescript, license extraction, filesize visualizer, JSON import, budgets, build progress, minifying and compression with brotli a…
Stars: ✭ 17 (-46.87%)
Mutual labels:  rollup-plugin
rollup-plugin-generate-package-json
Generate package.json file with packages from your bundle using Rollup
Stars: ✭ 29 (-9.37%)
Mutual labels:  rollup-plugin

rollup-plugin-typescript-paths

Build Status

Rollup Plugin to automatically resolve path aliases set in the compilerOptions section of tsconfig.json.

Don't use it if you're already using rollup-plugin-typescript. This plugin is only for use cases where your TypeScript code has already been transpiled before rollup runs.

For example, if you have

// tsconfig.json
{
  "compilerOptions": {
    // ...
    "baseUrl": ".",
    "paths": {
      "@utils": ["src/helpers/utils"]
    }
  }
}
import { something } from '@utils';

Then this plugin will make sure that rollup knows how to resolve @utils.

Features

  • No config required. 😎
  • Wildcards are supported. 💪
  • Uses nodeModuleNameResolver from the Typescript API. 🤓

Installation

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

Usage

import { typescriptPaths } from 'rollup-plugin-typescript-paths';

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

Options

  • absolute: Whether to resolve to absolute paths; defaults to true.
  • nonRelative: Whether to resolve non-relative paths based on tsconfig's baseUrl, even if none of the paths are matched; defaults to false.
  • preserveExtensions: Whether to preserve .ts and .tsx file extensions instead of having them changed to .js; defaults to false.
  • tsConfigPath: Custom path to your tsconfig.json. Use this if the plugin can't seem to find the correct one by itself.
  • transform: If the plugin successfully resolves a path, this function allows you to hook into the process and transform that path before it is returned.

License

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].