Skip to content

Commit e22d7f8

Browse files
committed
fix: fix title injection of the generated html file
1 parent ba5caf0 commit e22d7f8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/@vue/cli-service/__tests__/build.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ test('build', async () => {
2727
expect(project.has('dist/subfolder/index.html')).toBe(true)
2828

2929
const index = await project.read('dist/index.html')
30+
31+
// should have set the title inferred from the project name
32+
expect(index).toMatch(/<title>e2e-build<\/title>/)
33+
3034
// should split and preload app.js & vendor.js
3135
// expect(index).toMatch(/<link [^>]+js\/app[^>]+\.js" rel="preload" as="script">/)
3236
// expect(index).toMatch(/<link [^>]+js\/chunk-vendors[^>]+\.js" rel="preload" as="script">/)

packages/@vue/cli-service/lib/config/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module.exports = (api, options) => {
8383

8484
const htmlOptions = {
8585
title: api.service.pkg.name,
86-
templateParameters: (compilation, assets, pluginOptions) => {
86+
templateParameters: (compilation, assets, assetTags, pluginOptions) => {
8787
// enhance html-webpack-plugin's built in template params
8888
let stats
8989
return Object.assign({

0 commit comments

Comments
 (0)