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

1.0.2 • Public • Published

rollup-plugin-ts-treeshaking

Improve TypeScript tree-shaking with Rollup and UglifyJS/Terser.

Uses rollup-plugin-replace to replace /** @class */ annotations generated by TypeScript with /*@__PURE__*/ that can be used by uglifyjs, uglify-es and terser for dead code elimination.

MIT license

Installation

NPM

npm i -D rollup-plugin-ts-treeshaking

Yarn

yarn add -D rollup-plugin-ts-treeshaking

Usage

import typescript from 'rollup-plugin-typescript2';
import tsTreeshaking from 'rollup-plugin-ts-treeshaking';
 
export default {
  plugins: [
    typescript(),
    tsTreeshaking(),
    /* ... */
  ],
  /* ... */
};

Options

js

Enables processing of .js and .jsx files in addition to .ts and .tsx.

type: boolean
default: true

License

MIT

/rollup-plugin-ts-treeshaking/

    Package Sidebar

    Install

    npm i rollup-plugin-ts-treeshaking

    Weekly Downloads

    207

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    3.3 kB

    Total Files

    5

    Last publish

    Collaborators

    • ex-machine