From 4fbf65f7b26dddadb125fa15dcc339439550f439 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 9 Jan 2020 20:08:58 +0800 Subject: [PATCH] refactor: use the `title` option in the html template, instead of hard-code the project name closes #5056 --- .../@vue/cli-service/generator/template/public/index.html | 4 ++-- packages/@vue/cli-service/lib/config/app.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@vue/cli-service/generator/template/public/index.html b/packages/@vue/cli-service/generator/template/public/index.html index 06ac04291c..3d4e96efc2 100644 --- a/packages/@vue/cli-service/generator/template/public/index.html +++ b/packages/@vue/cli-service/generator/template/public/index.html @@ -5,11 +5,11 @@ - <%= rootOptions.projectName %> + <%%= htmlWebpackPlugin.options.title %%>
diff --git a/packages/@vue/cli-service/lib/config/app.js b/packages/@vue/cli-service/lib/config/app.js index c935c291a0..f940b4ad8c 100644 --- a/packages/@vue/cli-service/lib/config/app.js +++ b/packages/@vue/cli-service/lib/config/app.js @@ -84,6 +84,7 @@ module.exports = (api, options) => { } const htmlOptions = { + title: api.service.pkg.name, templateParameters: (compilation, assets, pluginOptions) => { // enhance html-webpack-plugin's built in template params let stats