Skip to content

Added ability to directly configure minification params

Latest
Compare
Choose a tag to compare
@a-ignatov-parc a-ignatov-parc released this 12 Apr 09:09

minify param in build section of ship.config.js can now have three possible values:

  1. true — will enable default minification using UglifyJS. Default params are:

    {
        compress: {
            warnings: true
        }
    }
  2. false — minification for production builds will be turned off.

  3. object — configuration that will be explicitly passed to webpack.optimize.UglifyJsPlugin constructor.

    For example if you need to disable function and class names minification you can do it this way:

    // ship.config.js
    module.exports = {
        ...
        build: {
            ...
            minify: {
                compress: {
                    warnings: true,
                    keep_fnames: true,
                },
                mangle: {
                    keep_fnames: true,
                },
            },
        },
    };