@vuepress/core 1.8.3 → 1.9.0
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.
- package/lib/node/App.js +1 -1
- package/lib/node/loadConfig.js +7 -1
- package/package.json +9 -7
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/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.0",
|
|
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.0",
|
|
29
|
+
"@vuepress/markdown-loader": "1.9.0",
|
|
30
|
+
"@vuepress/plugin-last-updated": "1.9.0",
|
|
31
|
+
"@vuepress/plugin-register-components": "1.9.0",
|
|
32
|
+
"@vuepress/shared-utils": "1.9.0",
|
|
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": "1440bbdaf6a12ed26e59c8350763f91526bca33c"
|
|
78
80
|
}
|