Skip to content

Commit d63bf9e

Browse files
committed
feat: support setting H5 title
1 parent 1c38d88 commit d63bf9e

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
3+
4+
<head>
45
<meta charset="utf-8">
56
<meta http-equiv="X-UA-Compatible" content="IE=edge">
67
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7-
<title>dist-h5</title>
8-
</head>
9-
<body>
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
</head>
10+
11+
<body>
1012
<noscript>
11-
<strong>We're sorry but dist-h5 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
<strong>We're sorry but dist-h5 doesn't work properly without JavaScript enabled. Please enable it to
14+
continue.</strong>
1215
</noscript>
1316
<div id="app"></div>
1417
<!-- built files will be auto injected -->
15-
</body>
16-
</html>
18+
</body>
19+
20+
</html>

packages/mars-cli-template/generator/template-h5/mars/vue.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@ module.exports = {
77
'@marsjs/api',
88
'@marsjs/components'
99
],
10-
parallel: false
10+
parallel: false,
11+
chainWebpack: config => {
12+
config
13+
.plugin('html')
14+
.tap(args => {
15+
args[0].title = 'Mars demo';
16+
return args;
17+
});
18+
}
1119
};

0 commit comments

Comments
 (0)