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

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

Cannot read property 'entry' of undefined

const?path=require("path");
var?htmlWebpackPlugin=require("html-webpack-plugin");
module.exports?=?{
//?configuration
//?entry:'./src/script/main.js',?//?單個(gè)string
//?entry:['./src/script/main.js','./src/script/a.js'],?//?數(shù)組,多個(gè)string
entry:{
mian:'./src/script/main.js',
a:'./src/script/a.js',
b:'./src/script/b.js',
c:'./src/script/c.js'
},
output:{
path:path.join(__dirname,"dist"),?//?打包目錄
filename:'js/[name]-[chunkhash].bundle.js',?//?js打包后的文件
publicPath:'http://www.iVue.com/'?//?占位符?線上地址
},
plugins:[
new?htmlWebpackPlugin({?//?調(diào)用一次插件生成單頁面
template:'index.html',
filename:'a-[hash].html',??//?index.[hash].html
inject:'head',//?false
title:'a?webpack?is?awesome',
date:new?Date(),
minify:{????//?壓縮html文件
removeComments:true,?//?刪除html注釋
collapseInlineTagWhiteSpace:true?//?刪除空格
}
}),
new?htmlWebpackPlugin({?//?調(diào)用多次生成多頁面
template:'index.html',
filename:'b-[hash].html',??//?index.[hash].html
inject:'head',//?false
title:'b?webpack?is?awesome',
date:new?Date(),
minify:{????//?壓縮html文件
removeComments:true,?//?刪除html注釋
collapseInlineTagWhiteSpace:true?//?刪除空格
}
}),
new?htmlWebpackPlugin({?//?調(diào)用多次生成多頁面
template:'index.html',
filename:'c-[hash].html',??//?index.[hash].html
inject:'head',//?false
title:'c?webpack?is?awesome',
date:new?Date(),
minify:{????//?壓縮html文件
removeComments:true,?//?刪除html注釋
collapseInlineTagWhiteSpace:true?//?刪除空格
}
})
]
};
<head>
<title><%=?htmlWebpackPlugin.options.title%></title>
<!--綁定title-->
<meta?charset="UTF-8">
<meta?name="viewport"?content="width=device-width,?initial-scale=1">
<script?src="<%=?htmlWebpackPlugin.files.chunks.main.entry%>"></script>
</head>

我在打包的時(shí)候,一直報(bào)錯(cuò)的語句

<%= htmlWebpackPlugin.files.chunks.main.entry%>

錯(cuò)誤提示:

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

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

??-?index.html:17172
????E:/Test/webpack/webpack-framework/index.html:17172:46

正在回答

2 回答

看一下你的第8行。。。。mian、main~曾經(jīng)多次敲錯(cuò)的英文單詞啊

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

杭州程序員張張 提問者

.....
2017-05-14 回復(fù) 有任何疑惑可以回復(fù)我~

我也是這個(gè)問題 請(qǐng)問解決了嗎 我看了一下我沒有寫錯(cuò)的地方啊

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

慕粉3777950

可能是你的模板index.html文件不夠干凈,<script src="<%= htmlWebpackPlugin.files.chunks.main.entry%>"></script>像這類語句,即便是注釋掉,實(shí)際上還是會(huì)去執(zhí)行的,所以需要把帶有<%%>這類腳本的注釋都去掉
2017-08-05 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

Cannot read property 'entry' of undefined

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

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

幫助反饋 APP下載

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

公眾號(hào)

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