<commit_before>var webpack = require('webpack')

exports.usage = "资源编译、打包";

exports.setOptions = (optimist) => {
    optimist.alias('m', 'min');
    optimist.describe('m', '压缩/混淆项目文件');
};

exports.run = function(options) {
	var cmdExecutedPath = process.cwd()

	webpack({
		context: cmdExecutedPath,
		entry: "./src/entry.js",
		output: {
			path: "./dist",
			filename: "bundle.js"
		},
		module: {
			loaders: [{
				test: /\.js$/,
				exclude: /(node_modules|bower_components)/,
				loader: 'babel',
				query: {
					presets: ['es2015']
				}
			}]
		},
        plugins: [
            options.m ? new webpack.optimize.UglifyJsPlugin({
                compress: {
                    warnings: false
                }
            }) : null
        ],
	}, function(err, stats) {
		if (err) {
			info(err);
			return
		}

		info('pack succeed');
	})
};<commit_msg>fix(pack): min err<commit_after>var webpack = require('webpack')

exports.usage = "资源编译、打包";

exports.setOptions = (optimist) => {
    optimist.alias('m', 'min');
    optimist.describe('m', '压缩/混淆项目文件');
};

exports.run = function(options) {
	var cmdExecutedPath = process.cwd(),
        plugins = []

    if(options.m){
        plugins.push(
            new webpack.optimize.UglifyJsPlugin({
                compress: {
                    warnings: false
                }
            })
        )
    }

	webpack({
		context: cmdExecutedPath,
		entry: "./src/entry.js",
		output: {
			path: "./dist",
			filename: "bundle.js"
		},
		module: {
			loaders: [{
				test: /\.js$/,
				exclude: /(node_modules|bower_components)/,
				loader: 'babel',
				query: {
					presets: ['es2015']
				}
			}]
		},
        plugins: plugins,
	}, function(err, stats) {
		if (err) {
			info(err);
			return
		}

		info('pack succeed');
	})
};
{'fraction_non_alphanumeric': 0.17371937639198218, 'fraction_numerical': 0.004454342984409799, 'mean_word_length': 2.0929432013769365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6052189', 'n_tokens_mistral': 736, 'n_tokens_neox': 648, 'n_words': 110}