Skip to content

Commit

Permalink
feat(compressor): add Terser documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
srod committed Oct 21, 2018
1 parent 90c9287 commit 70b31a5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ It allow you to compress JavaScript, CSS and HTML files.

- [babel-minify](https://node-minify.2clics.net/compressors/babel-minify.html)
- [Google Closure Compiler](https://node-minify.2clics.net/compressors/gcc.html)
- [terser](https://node-minify.2clics.net/compressors/terser.html)
- [uglify-js](https://node-minify.2clics.net/compressors/uglify-js.html)
- [uglify-es](https://node-minify.2clics.net/compressors/uglify-es.html)
- [YUI Compressor](https://node-minify.2clics.net/compressors/yui.html)
Expand Down
1 change: 1 addition & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
'compressors/csso',
'compressors/gcc',
'compressors/sqwish',
'compressors/terser',
'compressors/uglify-es',
'compressors/uglify-js',
'compressors/yui'
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ It allow you to compress JavaScript, CSS and HTML files.

- [babel-minify](/compressors/babel-minify.md)
- [Google Closure Compiler](/compressors/gcc.md)
- [terser](/compressors/terser.md)
- [uglify-js](/compressors/uglify-js.md)
- [uglify-es](/compressors/uglify-es.md)
- [YUI Compressor](/compressors/yui.md)
Expand Down
35 changes: 35 additions & 0 deletions docs/compressors/terser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# terser

`terser` can compress only JavaScript files.

[https://github.com/terser-js/terser](https://github.com/terser-js/terser)

## Usage

```js
compressor.minify({
compressor: 'terser',
input: 'foo.css',
output: 'bar.css',
callback: function(err, min) {}
});
```

## Options

```js
compressor.minify({
compressor: 'terser',
input: 'foo.js',
output: 'bar.js',
options: {
warnings: true, // pass true to display compressor warnings.
mangle: false // pass false to skip mangling names.
output: {} // pass an object if you wish to specify additional output options. The defaults are optimized for best compression.
compress: false // pass false to skip compressing entirely. Pass an object to specify custom compressor options.
},
callback: function (err, min) {}
});
```

[Check all options](https://github.com/terser-js/terser)

0 comments on commit 70b31a5

Please sign in to comment.