vue中index.html怎么写事件,如何在vue.js生成中重命名index.html?
因为您正在创建一个vue.config.js,所以我假设您正在使用vue cli 3.0。假设您应该在vue.config.js上添加以下行。module.exports = {// modify the location of the generated HTML file.// make sure to do this only in production.chainWebpack: (con
因为您正在创建一个vue.config.js,所以我假设您正在使用vue cli 3.0。
假设您应该在vue.config.js上添加以下行。
module.exports = {
// modify the location of the generated HTML file.
// make sure to do this only in production.
chainWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
config.plugin('html').tap((opts) => {
opts[0].filename = './dist/dapp.html';
return opts;
});
}
},
};
如果您使用的是vue webpack模板,则在配置文件夹中有一个index.js文件。在module.exports中,可以在以下位置设置输出:
...
build: {
// Template for index.html
index: path.resolve(__dirname, './dist/index.html'),
...
},
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)