vuecli3.0 htmlWebpackPlugin 报 ReferenceError: BASE
<head>
<link href="<%= BASE_URL %>favicon.ico"> // 这里BASE_URL报错
</head>
-------------------------------------------------
vue.config.js
config.plugins.push(
new HtmlWebpackPlugin({
template: ‘./public/index.html‘,
inject: true,
hash: new Date().getTime(),
url: BASE_URL, //需要这里传参
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
},
chunksSortMode: ‘manual‘
})
)
--------------------------------
<head>
<link href="<%= htmlWebpackPlugin.options.url %>favicon.ico"> //改成这种就ok了
</head>
vuecli3.0 htmlWebpackPlugin 报 ReferenceError: BASE_URL is not defined 错误
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/42544.html
- 上一篇:HTML DOM 学习
- 下一篇:去重,用js去两组数的重数