Skip to content

Replace alias paths with relative paths after typescript compilation during rollup bundling

License

Notifications You must be signed in to change notification settings

valentiniljaz/rollup-plugin-tsc-alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rollup plugin: tsc-alias

Replace alias paths with relative paths after typescript compilation during rollup bundling

Installation

npm

npm install rollup-plugin-tsc-alias --save-dev

yarn

yarn add rollup-plugin-tsc-alias --dev

Example

To run tsc-alias after TS built add the following to rollup.config.js:

import tscAlias from 'rollup-plugin-tsc-alias';

export default {
  entry: './src/index.ts',
  output: {
    dest: './dist/bundle.js',
  },
  plugins: [
    tscAlias()
  ]
};

Here are all the available options:

Option Description Default Value
configFile path to tsconfig.json 'tsconfig.json'
watch Observe file changes false
outDir Run in a folder leaving the "outDir" of the tsconfig.json (relative path to tsconfig) tsconfig.compilerOptions.outDir
declarationDir Works the same as outDir but for declarationDir tsconfig.compilerOptions.declarationDir
resolveFullPaths Attempt to replace incomplete import paths (those not ending in .js) with fully resolved paths (for ECMAScript Modules compatibility) false
silent Reduced terminal output. This is a deprecated option and no longer has any effect. true
verbose Additional information is output to the terminal false
replacers Files to import as extra replacers More info []
output The output object tsc-alias will send logs to. new Output(options.verbose)

License

MIT

About

Replace alias paths with relative paths after typescript compilation during rollup bundling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published