默认情况下 index.html 中 htmlWebpackPlugin.options.title 使用的是项目名称。

这里针对的是使用 Vue CLI 创建的项目

文档:
配置参考 | Vue CLI

在根目录添加 vue.config.js 文件,最简配置:

module.exports = {
  pages: {
    index: {
      entry: "src/main.js",
      title: "Custom Title",
    },
  },
};

如果添加了此配置,则 entry 是必选项,不再有默认值。

参考:
vue.js - Vue-Cli: 'title' option for htmlWebpackPlugin does not work - Stack Overflow

相关文章:

  • 2022-12-23
  • 2021-04-08
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
猜你喜欢
  • 2021-06-24
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2021-06-21
相关资源
相似解决方案