
const {resolve} = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

/**
 * output:
 *   filename:指定名称+目录
 *   path：指定目录
 *   publicPath: '/'   所有资源的引入公共路径前缀 例：'imgs/a.jpb' => '/imgs/a.jpg'
 *   chunkFilename: '[name]_chunk.js'   非入口chunk的名称
 *   library：'[name]' 向外暴露
 *   libraryTarget: 'window'  指定向外暴露变量名
 */
module.exports = {
    entry: './src/index.js',
    output: {
        filename:'[name].js',
        path:resolve(__dirname,'build')
    },
    plugins: [
        new HtmlWebpackPlugin()
    ],
    mode: 'development'
}