因为您正在创建一个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'),
...
},