https://github.com/ex-machine/rollup-plugin-ts-treeshaking
Improve TypeScript tree-shaking with Rollup and UglifyJS/Terser
https://github.com/ex-machine/rollup-plugin-ts-treeshaking
minify rollup rollup-plugin rollup-plugin-typescript terser tree-shaking typescript uglify uglifyjs
Last synced: 6 months ago
JSON representation
Improve TypeScript tree-shaking with Rollup and UglifyJS/Terser
- Host: GitHub
- URL: https://github.com/ex-machine/rollup-plugin-ts-treeshaking
- Owner: ex-machine
- License: mit
- Created: 2018-10-14T08:24:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-25T21:43:10.000Z (over 4 years ago)
- Last Synced: 2024-11-29T13:34:44.364Z (6 months ago)
- Topics: minify, rollup, rollup-plugin, rollup-plugin-typescript, terser, tree-shaking, typescript, uglify, uglifyjs
- Language: JavaScript
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
[](https://lbesson.mit-license.org/)
## Installation
### NPM
```
npm i -D rollup-plugin-ts-treeshaking
```### Yarn
```
yarn add -D rollup-plugin-ts-treeshaking
```## Usage
```js
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](LICENSE)