项目作者: ex-machine

项目描述 :
Improve TypeScript tree-shaking with Rollup and UglifyJS/Terser
高级语言: JavaScript
项目地址: git://github.com/ex-machine/rollup-plugin-ts-treeshaking.git
创建时间: 2018-10-14T08:24:22Z
项目社区:https://github.com/ex-machine/rollup-plugin-ts-treeshaking

开源协议:MIT License

下载


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

  1. npm i -D rollup-plugin-ts-treeshaking

Yarn

  1. yarn add -D rollup-plugin-ts-treeshaking

Usage

  1. import typescript from 'rollup-plugin-typescript2';
  2. import tsTreeshaking from 'rollup-plugin-ts-treeshaking';
  3. export default {
  4. plugins: [
  5. typescript(),
  6. tsTreeshaking(),
  7. /* ... */
  8. ],
  9. /* ... */
  10. };

Options

js

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

type: boolean
default: true

License

MIT