Skip to content

Commit

Permalink
feat: 添加config.head配置介绍
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang committed Aug 1, 2019
1 parent 0cf6e22 commit c533549
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ module.exports = {
}
],
template: resolvePath('web/index.html'), // 使用的模版文件路径
baseHtml: 'string', // 自定义模版的html内容,会优先使用baseHtml后使用template,在需要动态设置meta信息的时候可以使用该选项
head: [
'<meta description=xxx />',
'<title>title</title>'
], // 自定义头部内容,通常在动态设置meta信息的时候用到
injectCss: (chunkName) => ([
`<link rel='stylesheet' href='/static/css/${chunkName}.chunk.css' />`
]), // 客户端需要加载的静态css文件资源
Expand Down
2 changes: 1 addition & 1 deletion example/ssr-with-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "egg-ssr",
"version": "1.1.5",
"version": "1.2.5",
"dependencies": {
"egg": "^2.21.0",
"egg-proxy": "^1.1.0",
Expand Down
1 change: 1 addition & 0 deletions example/ssr-with-js/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<title>React App</title>
<!-- Start Server Render Head -->
<!-- Start Injecting Style Flows Up and Down -->
</head>

Expand Down
5 changes: 3 additions & 2 deletions packages/ykfe-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ykfe-utils",
"version": "1.3.8",
"version": "1.4.8",
"description": "",
"main": "lib/index.js",
"module": "es/index.js",
Expand All @@ -20,7 +20,8 @@
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.5.5"
"@babel/runtime": "^7.5.5",
"concurrently": "^4.1.1"
},
"dependencies": {
"multistream": "^2.1.1",
Expand Down

0 comments on commit c533549

Please sign in to comment.