百度过许多方法 都感觉不够简洁 参考了vue-element-admin项目的方法 分享一下

首先配置vue.config.js文件

添加下面的配置

configureWebpack: {
    // provide the app's title in webpack's name field, so that
    // it can be accessed in index.html to inject the correct title.
    // js打包编译后的文件名称【模块名称.时间戳】
    // output: {
    //   filename: `[name].${Timestamp}.js`,
    //   chunkFilename: `[name]${Timestamp}.js`
    // },
    name: '你要设置的标签名',
}

然后到public文件下找到index.html模板文件

 把红框部分修改成 webpackConfig.name

 这样 标题就修改完成了 特别简单 所有vue-cli项目通用

Logo

前往低代码交流专区