const {resolve} = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const EsLintPlugin = require('eslint-webpack-plugin')
module.exports = {
    entry:'./src/js/index.js',
    output:{
        filename:'js/built.js',
        path:resolve(__dirname,'build')
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:'./src/index.html'
        }),
        new EsLintPlugin({
            extensions: ['js', 'json', 'coffee'],
            //exclude: '/node_modules/', //default
            fix:true
        })
    ],
    mode:'production'  //生产环境下会自动压缩
}