第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

本節(jié)最后的問題

http://img1.sycdn.imooc.com//58abe5b20001b24d05180567.jpg

ERROR in Template execution failed: TypeError: Cannot read property 'entry' of undefined


ERROR in ? TypeError: Cannot read property 'entry' of undefined


<%= compilation.assets[htmlWebpackPlugin.files.chunks.main.entry.substr(htmlWebpackPlugin.files.publicPath.length)].source() %> ?取不到entry嗎? 為什么?這里有點(diǎn)懵

正在回答

3 回答

你的plugins里chunks少了main

2 回復(fù) 有任何疑惑可以回復(fù)我~
#1

_莫忘初衷_ 提問者

3Q
2017-02-21 回復(fù) 有任何疑惑可以回復(fù)我~

// 解決了hash問題,以及生成html文件,壓縮html,自動(dòng)引入帶hash的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',

// 此key上線時(shí)需要,為絕對(duì)路徑。

publicPath:'http://www.yangshaofeng.cn/'

},

plugins: [

new htmlWebpackPlugin({

filename:'a.html',

template:'index.html',

title:'this is a.html',

inject:'body',

minify:{

removeComments:true,

collapseWhitespace:true

},

excludeChunks:['b','c']

}),

new htmlWebpackPlugin({

filename:'b.html',

template:'index.html',

title:'this is b.html',

inject:'body',

minify:{

removeComments:true,

collapseWhitespace:true

},

excludeChunks:['main','a','c']

}),

new htmlWebpackPlugin({

filename:'c.html',

template:'index.html',

title:'this is c.html',

inject:'body',

minify:{

removeComments:true,

collapseWhitespace:true

},

excludeChunks:['main','a','b']

})

]

}

求助

0 回復(fù) 有任何疑惑可以回復(fù)我~

更新下node


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

_莫忘初衷_ 提問者

我的已經(jīng)是最新版本node v6.2.0
2017-02-21 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

本節(jié)最后的問題

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)