'use strict';

var pkg = require('./package.json');
var webpack = require('webpack');

var SafeUmdPlugin = require('safe-umd-webpack-plugin');

var isProduction = process.argv.indexOf('-p') > -1;

var FILENAME = pkg.name + (isProduction ? '.min.js' : '.js');
var BANNER = [
    FILENAME,
    '@version ' + pkg.version,
    '@author ' + pkg.author,
    '@license ' + pkg.license
].join('\n');

module.exports = {
    eslint: {
        failOnError: isProduction
    },
    entry: './src/js/index.js',
    output: {
        library: ['tui', 'util'],
        libraryTarget: 'umd',
        path: 'dist',
        publicPath: 'dist',
        filename: FILENAME
    },
    module: {
        preLoaders: [
            {
                test: /\.js$/,
                exclude: /(bower_components|node_modules)/,
                loader: 'eslint-loader'
            }
        ]
    },
    plugins: [
        new SafeUmdPlugin(),
        new webpack.BannerPlugin(BANNER)
    ]
};

@@ -1,8 +1,112 @@
+/**%0A * Configs file for bundling%0A * @author NHN Ent. FE Development Lab %3Cdl_javascript@nhnent.com%3E%0A */%0A%0A
 'use str
@@ -294,16 +294,130 @@
  %3E -1;%0A%0A
+var uglifyJsPlugin = new webpack.optimize.UglifyJsPlugin(%7B%0A    compress: %7B%0A        'properties': false%0A    %7D%0A%7D);%0A%0A
 var FILE
@@ -608,22 +608,18 @@
 );%0A%0A
-module.exports
+var config
  = %7B
@@ -1175,7 +1175,97 @@
   %5D%0A
-
 %7D;%0A
+%0Aif (isProduction) %7B%0A    config.plugins.push(uglifyJsPlugin);%0A%7D%0A%0Amodule.exports = config;%0A

update webpack config file