/**
 * @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com>
 * @fileoverview webpack 설정파일
 */

'use strict';

var webpack = require('webpack');
var path = require('path');
var pkg = require('./package.json');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

var ENTRY_PATH = './src/js/chart.js';
var BUNDLE_PATH = path.join(__dirname, 'dist/');
var BUNDLE_FILENAME = 'chart';

var isProduction = process.argv.indexOf('--production') >= 0;
var isMinified = process.argv.indexOf('--minify') >= 0;

var eslintLoader = {
    test: /\.js$/,
    exclude: /(node_modules|bower_components)/,
    configFile: './.eslintrc',
    loader: 'eslint'
};

var lessLoader = {
    test: /\.less$/,
    loader: ExtractTextPlugin.extract('css-loader!less?paths=src/less/')
};

module.exports = (function() {
    var readableTimestamp = (new Date()).toString();
    var bannerText = '@fileoverview ' + pkg.name + '\n' +
        '@author ' + pkg.author + '\n' +
        '@version ' + pkg.version + '\n' +
        '@license ' + pkg.license + '\n' +
        '@link ' + pkg.repository.url + '\n' +
        'bundle created at "' + readableTimestamp + '"';

    // Basic setting
    var config = {
        entry: ENTRY_PATH,
        debug: false,
        output: {
            path: BUNDLE_PATH,
            publicPath: '/dist/',
            // We make minify file only in production build
            // 개발 테스트시에 서비스 코드의 수정없이 미니파이된 파일도 테스트 할수 있게 하기위해 미니 파일 파일은 프로덕션 빌드에서만 만든다
            filename: BUNDLE_FILENAME + (isProduction && isMinified ? '.min' : '') + '.js'
        },
        module: {
            preLoaders: [eslintLoader],
            loaders: [lessLoader]
        },
        eslint: {
            failOnError: true
        },
        plugins: [
            new ExtractTextPlugin(BUNDLE_FILENAME + (isProduction && isMinified ? '.min' : '') + '.css')
        ],
        cache: false
    };

    if (!isProduction) {
        // Dev server setting
        Object.assign(config, {
            devtool: '#inline-source-map',
            debug: true,
            devServer: {
                host: '0.0.0.0',
                port: 8080,
                contentBase: __dirname,
                noInfo: true,
                quiet: false,
                stats: {
                    colors: true
                }
            }
        });

        Object.assign(config.eslint, {
            quiet: true,
            failOnError: false
        });
    }

    if (isMinified) {
        config.plugins.push(new webpack.optimize.UglifyJsPlugin({
            compress: {warnings: false},
            output: {comments: false}
        }));
    }

    config.plugins.push(new webpack.BannerPlugin(bannerText, {entryOnly: true}));

    return config;
})();

@@ -1618,23 +1618,11 @@
 s: %5B
-eslintLoader
 %5D,%0A
+
     
@@ -1666,67 +1666,8 @@
  %7D,%0A
-        eslint: %7B%0A            failOnError: true%0A        %7D,%0A
     
@@ -1834,17 +1834,16 @@
     if (
-!
 isProduc
@@ -1846,24 +1846,200 @@
 oduction) %7B%0A
+        // Production setting%0A        Object.assign(config.eslint, %7B%0A            failOnError: true%0A        %7D);%0A%0A        config.module.preLoaders = %5BeslintLoader%5D;%0A    %7D else %7B%0A
         // D
@@ -2410,32 +2410,32 @@
               %7D%0A
+
             %7D%0A  
@@ -2447,116 +2447,8 @@
  %7D);
-%0A%0A        Object.assign(config.eslint, %7B%0A            quiet: true,%0A            failOnError: false%0A        %7D);
 %0A   

Remove ESLint preleader on DEV server mode bundling for development issue