vue怎样修改标题 <%= htmlWebpackPlugin.options.title %>
这么改报错。
// vue.config.js
module.exports = {
configureWebpack: config => {
config.devtool ='source-map';
config
.plugin('html')
.tap(args => {
args[0].title= 'test'
return args
})
}
}
ERROR TypeError: config.plugin is not a function
TypeError: config.plugin is not a function
at configureWebpack (D:\wgf\My Documents\Github\pyprojects\ups_project\client\vue.config.js:6:14)
at D:\wgf\My Documents\Github\pyprojects\ups_project\client\node_modules\@vue\cli-service\lib\Service.js:266:21
at Array.forEach (<anonymous>)
at Service.resolveWebpackConfig (D:\wgf\My Documents\Github\pyprojects\ups_project\client\node_modules\@vue\cli-service\lib\Service.js:263:30)
at PluginAPI.resolveWebpackConfig (D:\wgf\My Documents\Github\pyprojects\ups_project\client\node_modules\@vue\cli-service\lib\PluginAPI.js:132:25)
at serve (D:\wgf\My Documents\Github\pyprojects\ups_project\client\node_modules\@vue\cli-service\lib\commands\serve.js:74:31)
at Service.run (D:\wgf\My Documents\Github\pyprojects\ups_project\client\node_modules\@vue\cli-service\lib\Service.js:245:12)
at Object.<anonymous> (D:\wgf\My Documents\Github\pyprojects\ups_project\client\node_modules\@vue\cli-service\bin\vue-cli-service.js:36:9)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! del1@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the del1@0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\wgf\AppData\Roaming\npm-cache\_logs\2020-05-28T06_54_26_317Z-debug.log
Process finished with exit code 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
是
chainWebpack
吧在main.js 可以动态设置标题
是name属性把
写在 chainWebpack 里面就可以了
把“configureWebpack”改成“chainWebpack”就可以了……谢谢你后面的那几行代码,刚好给我用上了!