stc-uglify

1.0.8 • Public • Published

stc-uglify

Use UglifyJS to compress JavaScript

Install

npm install stc-uglify

How to use

//stc.config.js
 
import uglify from 'stc-uglify';
 
stc.workflow({
  jsCompress: {plugin: uglify, include: /\.js$/, options: {}}
});
 

支持的配置

// 详细文档参考: https://github.com/mishoo/UglifyJS
// 部分配置需要参考代码
{
    strict_semicolons: false,
 
    mangle_options: {
        // angularjs --> mangle: false
        mangle       : true,
        toplevel     : false,
        defines      : null,
        except       : null,
        no_functions : false
    }, 
    squeeze_options: {
        make_seqs   : true,
        dead_code   : true,
        no_warnings : false,
        keep_comps  : true,
        unsafe      : false
    }, 
    gen_options: {
        indent_start : 0,
        indent_level : 4,
        quote_keys   : false,
        space_colon  : false,
        beautify     : false,
        ascii_only   : false,
        inline_script: false
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i stc-uglify

Weekly Downloads

5

Version

1.0.8

License

none

Last publish

Collaborators

  • welefen