@vuepress/core 1.8.2 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import unionBy from 'lodash/unionBy'
|
|
2
|
+
import escape from 'escape-html'
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
// created will be called on both client and ssr
|
|
@@ -132,7 +133,7 @@ function renderPageMeta (meta) {
|
|
|
132
133
|
return meta.map(m => {
|
|
133
134
|
let res = `<meta`
|
|
134
135
|
Object.keys(m).forEach(key => {
|
|
135
|
-
res += ` ${key}="${m[key]}"`
|
|
136
|
+
res += ` ${key}="${escape(m[key])}"`
|
|
136
137
|
})
|
|
137
138
|
return res + `>`
|
|
138
139
|
}).join('\n ')
|
package/lib/node/App.js
CHANGED
|
@@ -61,7 +61,7 @@ module.exports = class App {
|
|
|
61
61
|
if (this.options.siteConfig) {
|
|
62
62
|
this.siteConfig = this.options.siteConfig
|
|
63
63
|
} else {
|
|
64
|
-
let siteConfig = loadConfig(this.vuepressDir)
|
|
64
|
+
let siteConfig = await loadConfig(this.vuepressDir)
|
|
65
65
|
if (isFunction(siteConfig)) {
|
|
66
66
|
siteConfig = await siteConfig(this)
|
|
67
67
|
}
|
package/lib/node/Page.js
CHANGED
package/lib/node/loadConfig.js
CHANGED
|
@@ -12,10 +12,11 @@ const tomlParser = require('toml')
|
|
|
12
12
|
* Expose loadConfig.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
module.exports = function loadConfig (vuepressDir, bustCache = true) {
|
|
15
|
+
module.exports = async function loadConfig (vuepressDir, bustCache = true) {
|
|
16
16
|
const configPath = path.resolve(vuepressDir, 'config.js')
|
|
17
17
|
const configYmlPath = path.resolve(vuepressDir, 'config.yml')
|
|
18
18
|
const configTomlPath = path.resolve(vuepressDir, 'config.toml')
|
|
19
|
+
const configTsPath = path.resolve(vuepressDir, 'config.ts')
|
|
19
20
|
|
|
20
21
|
if (bustCache) {
|
|
21
22
|
delete require.cache[configPath]
|
|
@@ -25,6 +26,11 @@ module.exports = function loadConfig (vuepressDir, bustCache = true) {
|
|
|
25
26
|
let siteConfig = {}
|
|
26
27
|
if (fs.existsSync(configYmlPath)) {
|
|
27
28
|
siteConfig = parseConfig(configYmlPath)
|
|
29
|
+
} else if (fs.existsSync(configTsPath)) {
|
|
30
|
+
const { mod } = await require('bundle-require').bundleRequire({
|
|
31
|
+
filepath: configTsPath
|
|
32
|
+
})
|
|
33
|
+
siteConfig = mod.default || mod
|
|
28
34
|
} else if (fs.existsSync(configTomlPath)) {
|
|
29
35
|
siteConfig = parseConfig(configTomlPath)
|
|
30
36
|
} else if (fs.existsSync(configPath)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "Minimalistic doc generator with Vue component based layout system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/core": "^7.8.4",
|
|
27
27
|
"@vue/babel-preset-app": "^4.1.2",
|
|
28
|
-
"@vuepress/markdown": "1.
|
|
29
|
-
"@vuepress/markdown-loader": "1.
|
|
30
|
-
"@vuepress/plugin-last-updated": "1.
|
|
31
|
-
"@vuepress/plugin-register-components": "1.
|
|
32
|
-
"@vuepress/shared-utils": "1.
|
|
28
|
+
"@vuepress/markdown": "1.9.2",
|
|
29
|
+
"@vuepress/markdown-loader": "1.9.2",
|
|
30
|
+
"@vuepress/plugin-last-updated": "1.9.2",
|
|
31
|
+
"@vuepress/plugin-register-components": "1.9.2",
|
|
32
|
+
"@vuepress/shared-utils": "1.9.2",
|
|
33
33
|
"autoprefixer": "^9.5.1",
|
|
34
34
|
"babel-loader": "^8.0.4",
|
|
35
|
+
"bundle-require": "2.1.8",
|
|
35
36
|
"cache-loader": "^3.0.0",
|
|
36
37
|
"chokidar": "^2.0.3",
|
|
37
38
|
"connect-history-api-fallback": "^1.5.0",
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
"core-js": "^3.6.4",
|
|
40
41
|
"cross-spawn": "^6.0.5",
|
|
41
42
|
"css-loader": "^2.1.1",
|
|
43
|
+
"esbuild": "0.14.7",
|
|
42
44
|
"file-loader": "^3.0.1",
|
|
43
45
|
"js-yaml": "^3.13.1",
|
|
44
46
|
"lru-cache": "^5.1.1",
|
|
@@ -74,5 +76,5 @@
|
|
|
74
76
|
"email": "chl814@foxmail.com"
|
|
75
77
|
}
|
|
76
78
|
],
|
|
77
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "ed3cce631767c3bb17c6d3e317f2c3242e9669cf"
|
|
78
80
|
}
|