@vuepress/core 2.0.0-rc.29 → 2.0.0-rc.30
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/dist/index.js +19 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -12,7 +12,6 @@ const prepareClientConfigs = async (app) => {
|
|
|
12
12
|
const clientConfigFiles = await app.pluginApi.hooks.clientConfigFile.process(app);
|
|
13
13
|
const content = `\
|
|
14
14
|
${clientConfigFiles.map((filePath, index) => `import * as clientConfig${index} from '${filePath}'`).join("\n")}
|
|
15
|
-
${app.options.userStyle ? `\nimport '${app.options.userStyle}'` : ""}
|
|
16
15
|
|
|
17
16
|
export const clientConfigs = [
|
|
18
17
|
${clientConfigFiles.map((_, index) => ` clientConfig${index},`).join("\n")}
|
|
@@ -501,6 +500,22 @@ export const ${SITE_DATA_VAR_NAME} = JSON.parse(${JSON.stringify(JSON.stringify(
|
|
|
501
500
|
await app.writeTemp("internal/siteData.js", content);
|
|
502
501
|
};
|
|
503
502
|
//#endregion
|
|
503
|
+
//#region src/app/prepare/prepareUserStyle.ts
|
|
504
|
+
/**
|
|
505
|
+
* Generate user style temp file
|
|
506
|
+
*
|
|
507
|
+
* @internal
|
|
508
|
+
*/
|
|
509
|
+
const prepareUserStyle = async (app, fileExists = null) => {
|
|
510
|
+
let content = "";
|
|
511
|
+
const { userStyle } = app.options;
|
|
512
|
+
if (userStyle) {
|
|
513
|
+
const userStylePath = app.dir.source(userStyle);
|
|
514
|
+
if (fileExists ?? await fs.pathExists(userStylePath)) content += `import ${JSON.stringify(userStylePath)}\n`;
|
|
515
|
+
}
|
|
516
|
+
await app.writeTemp("internal/userStyle.js", content);
|
|
517
|
+
};
|
|
518
|
+
//#endregion
|
|
504
519
|
//#region src/app/resolveAppMarkdown.ts
|
|
505
520
|
/**
|
|
506
521
|
* Resolve markdown-it instance for vuepress app
|
|
@@ -598,7 +613,8 @@ const appPrepare = async (app) => {
|
|
|
598
613
|
...app.pages.map(async (page) => preparePageChunk(app, page)),
|
|
599
614
|
prepareRoutes(app),
|
|
600
615
|
prepareSiteData(app),
|
|
601
|
-
prepareClientConfigs(app)
|
|
616
|
+
prepareClientConfigs(app),
|
|
617
|
+
prepareUserStyle(app)
|
|
602
618
|
]);
|
|
603
619
|
await app.pluginApi.hooks.onPrepared.process(app);
|
|
604
620
|
log$2("prepare finish");
|
|
@@ -1004,4 +1020,4 @@ const createDevApp = (config) => {
|
|
|
1004
1020
|
return app;
|
|
1005
1021
|
};
|
|
1006
1022
|
//#endregion
|
|
1007
|
-
export { DEFAULT_IGNORE_PATTERNS, appInit, appPrepare, appUse, createAppDirFunction, createBaseApp, createBuildApp, createDevApp, createHookQueue, createPage, createPluginApi, createPluginApiHooks, createPluginApiRegisterHooks, inferPagePath, normalizeAliasDefineHook, normalizeClientConfigFileHook, parsePageContent, prepareClientConfigs, preparePageChunk, prepareRoutes, prepareSiteData, renderPageToVue, resolveAppDir, resolveAppEnv, resolveAppOptions, resolveAppPages, resolveAppSiteData, resolveAppVersion, resolveAppWriteTemp, resolvePageChunkInfo, resolvePageContent, resolvePageDate, resolvePageFilePath, resolvePageHtmlInfo, resolvePageLang, resolvePagePath, resolvePagePermalink, resolvePageRouteMeta, resolvePageSlug, resolvePluginObject, resolveThemeInfo };
|
|
1023
|
+
export { DEFAULT_IGNORE_PATTERNS, appInit, appPrepare, appUse, createAppDirFunction, createBaseApp, createBuildApp, createDevApp, createHookQueue, createPage, createPluginApi, createPluginApiHooks, createPluginApiRegisterHooks, inferPagePath, normalizeAliasDefineHook, normalizeClientConfigFileHook, parsePageContent, prepareClientConfigs, preparePageChunk, prepareRoutes, prepareSiteData, prepareUserStyle, renderPageToVue, resolveAppDir, resolveAppEnv, resolveAppOptions, resolveAppPages, resolveAppSiteData, resolveAppVersion, resolveAppWriteTemp, resolvePageChunkInfo, resolvePageContent, resolvePageDate, resolvePageFilePath, resolvePageHtmlInfo, resolvePageLang, resolvePagePath, resolvePagePermalink, resolvePageRouteMeta, resolvePageSlug, resolvePluginObject, resolveThemeInfo };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/core",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.30",
|
|
4
4
|
"description": "Core package of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"core",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"vue": "^3.5.34",
|
|
35
|
-
"@vuepress/
|
|
36
|
-
"@vuepress/
|
|
37
|
-
"@vuepress/
|
|
38
|
-
"@vuepress/
|
|
35
|
+
"@vuepress/shared": "2.0.0-rc.30",
|
|
36
|
+
"@vuepress/utils": "2.0.0-rc.30",
|
|
37
|
+
"@vuepress/client": "2.0.0-rc.30",
|
|
38
|
+
"@vuepress/markdown": "2.0.0-rc.30"
|
|
39
39
|
},
|
|
40
40
|
"tsdown": {
|
|
41
41
|
"dts": true,
|