Giter Site home page Giter Site logo

cush-plugin-uglify-js's Introduction

cush-plugin-uglify-js v0.1.0

Minify assets using uglify-js.

By default, minification occurs in both development and production modes. This way, you can catch any rare bugs caused by minification, resulting in a better user experience.

The default settings for minification were carefully selected to avoid losing information that's necessary for useful source maps. Transforms which are unlikely to cause bugs are disabled in development mode for performance.

Configuration

The uglify setting can be configured by your cush.config.js module. Set it to false to disable minification, or provide uglify options to customize how modules are minified.

// Inline single-use variables and functions, but make source maps less useful.
this.set('uglify', {
  compress: {
    inline: true,
    reduce_vars: true,
    reduce_funcs: true,
    collapse_vars: true,
  }
});

Default settings

You can override any of these defaults.

The "always disabled" settings typically reduce the usefulness of source maps or slow down the build process more than they're worth.

Always disabled:

  • compress
    • collapse_vars
    • hoist_props
    • inline
    • loops
    • properties
    • reduce_funcs
    • reduce_vars
    • side_effects
    • typeofs
    • warnings

Production only:

  • mangle
  • toplevel
  • warnings
  • keep_fnames: false
  • output
    • beautify
    • semicolons
    • quote_style: 0
  • compress
    • arguments
    • booleans
    • comparisons
    • conditionals
    • dead_code
    • drop_debugger
    • evaluate
    • if_returns
    • join_vars
    • sequences
    • switches
    • unused

cush-plugin-uglify-js's People

Contributors

aleclarson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.