-
Notifications
You must be signed in to change notification settings - Fork 50
/
html.js
executable file
·41 lines (37 loc) · 1.11 KB
/
html.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var config = require('./config')
module.exports = function (args) {
var bundleCss = ''
var bundleJs = ''
if (args[0] === 'production') {
bundleCss = `<link rel="stylesheet" type="text/css" href="/static/style.css">`
bundleJs = `<script src="/static/bundle.js"></script>`
} else {
bundleJs = `<script src="http://localhost:${config.localWebpackPort}/bundle.js"></script>`
}
return `
<!DOCTYPE html>
<html lang="zh-cn">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible"
content="IE=edge">
<meta name="format-detection"
content="telephone=no">
${bundleCss}
<title>Fit Design</title>
<body>
<div id='react-dom'></div>
</body>
<script src="/static/dll/library.dll.js"></script>
${bundleJs}
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?9e6356ee54313747e9bbdb40ecdfa809";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</html>
`
}