webpack

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
    devtool: 'inline-source-map',
    //单个入口文件
   /* entry: './src/index.js',
    output: {
        filename: '[name].bundle.js',
        path: path.resolve(__dirname, 'dist')
    },*/
    entry:{
        app:'./src/index.js',
        print:'./src/print.js'
    },
    output: {
        filename: "[name].bundle.js",
        path: path.resolve(__dirname,'dist')
    },
    devServer: {
        contentBase:'./dist'
    },
    module: {
        rules: [
            {
                test:/\.css/,
                use:['style-loader','css-loader']
            }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
              title: 'Output Management'
     })
   ],

};

你可能感兴趣的:(webpack)