问答详情
源自:-

老师webpack多页面报错 ,怎么解决

 http://img.mukewang.com/58cffc270001d02e07420502.jpg

下面附有webpack.config.js代码,大牛帮忙看下哪里有问题

var htmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: {
        main: "./src/script/main.js",
        a: "./src/script/a.js",
        b: "./src/script/b.js",
        c: "./src/script/c.js"
    },
     output: {
        path: './dist',
        
        filename: 'js/[name]-[chunkhash].js',
        publicPath:'http://cdn.com/'
    },
     plugins:[
        new htmlWebpackPlugin({
            filename:'a.html',
            template:'index.html',
            title:'this is a!',
            inject:'body',        
            chunks:['main','a']   
        }),
        new htmlWebpackPlugin({
            filename:'b.html',
            template:'index.html',
            title:'this is b!',
            inject:'body',     
            chunks:['b']      
        }),
        new htmlWebpackPlugin({
            filename:'c.html',
            template:'index.html', 
            title:'this is c!',
            inject:'body',    
            chunks:['c'] 
          
        })
    ]




}


提问者:qq_木头人春天_0 2017-03-21 00:01

个回答

  • Jokerss
    2017-03-21 23:22:12

    是否是你的webpack安装的问题