为了账号安全,请及时绑定邮箱和手机立即绑定

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

 http://img1.sycdn.imooc.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'] 
          
        })
    ]




}


正在回答

1 回答

是否是你的webpack安装的问题

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

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

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信