/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
import CopyWebpackPlugin from 'copy-webpack-plugin';
import OpenBrowserPlugin from 'open-browser-webpack-plugin';
import path from 'path';

const { NODE_ENV } = process.env;

const entry = [];
const plugins = [];

if (NODE_ENV === 'development') {
    entry.push('webpack-dev-server/client?http://localhost:8100');
    plugins.push(new OpenBrowserPlugin({
        url: 'http://localhost:8100',
        ignoreErrors: true
    }));
}

entry.push('./js/index');
plugins.push(new CopyWebpackPlugin([
	{ from: 'css/style.css' },
	{ from: 'index.html' },
	{ from: 'img' },
    { from: 'service-worker.js' }
]));

module.exports = {
    entry,
    plugins,
    context: path.resolve(__dirname, '..'),
    output: {
        path: path.resolve('dist/'),
        filename: 'js/app.js',
        library: 'app',
        libraryTarget: 'var'
    },
    module: {
        loaders: [{
            test: /.js?$/,
            loaders: ['babel', 'eslint'],
            include: path.resolve('js/')
        }]
    },
    devtool: 'source-map',
    eslint: {
        configFile: '.eslintrc.json'
    }
};

@@ -522,16 +522,43 @@
 ry.push(
+%0A    'babel-polyfill',%0A    
 './js/in
@@ -561,19 +561,21 @@
 s/index'
+%0A
 );%0A
+%0A
 plugins.

add babel-polyfill, close #25