vitepress 0.22.1 → 0.22.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.
|
@@ -4,12 +4,11 @@ import { useRoute, useData } from 'vitepress'
|
|
|
4
4
|
import { isSideBarEmpty, getSideBarConfig } from './support/sideBar'
|
|
5
5
|
|
|
6
6
|
// components
|
|
7
|
+
import Home from './components/Home.vue'
|
|
7
8
|
import NavBar from './components/NavBar.vue'
|
|
8
9
|
import SideBar from './components/SideBar.vue'
|
|
9
10
|
import Page from './components/Page.vue'
|
|
10
11
|
|
|
11
|
-
const Home = defineAsyncComponent(() => import('./components/Home.vue'))
|
|
12
|
-
|
|
13
12
|
const NoopComponent = () => null
|
|
14
13
|
|
|
15
14
|
const CarbonAds = __CARBON__
|
package/dist/node/cli.js
CHANGED
package/dist/node/index.js
CHANGED
|
@@ -37107,7 +37107,7 @@ function getGitTimestamp(file) {
|
|
|
37107
37107
|
}
|
|
37108
37108
|
|
|
37109
37109
|
const debug$2 = _debug("vitepress:md");
|
|
37110
|
-
const cache = new lruCache({ max: 1024 });
|
|
37110
|
+
const cache$1 = new lruCache({ max: 1024 });
|
|
37111
37111
|
const includesRE = /<!--\s*@include:\s*(.*?)\s*-->/g;
|
|
37112
37112
|
function createMarkdownToVueRenderFn(srcDir, options = {}, pages, userDefines, isBuild = false, includeLastUpdatedData = false) {
|
|
37113
37113
|
const md = createMarkdownRenderer(srcDir, options);
|
|
@@ -37116,7 +37116,7 @@ function createMarkdownToVueRenderFn(srcDir, options = {}, pages, userDefines, i
|
|
|
37116
37116
|
return async (src, file, publicDir) => {
|
|
37117
37117
|
const relativePath = slash(path__default["default"].relative(srcDir, file));
|
|
37118
37118
|
const dir = path__default["default"].dirname(file);
|
|
37119
|
-
const cached = cache.get(src);
|
|
37119
|
+
const cached = cache$1.get(src);
|
|
37120
37120
|
if (cached) {
|
|
37121
37121
|
debug$2(`[cache hit] ${relativePath}`);
|
|
37122
37122
|
return cached;
|
|
@@ -37181,7 +37181,7 @@ function createMarkdownToVueRenderFn(srcDir, options = {}, pages, userDefines, i
|
|
|
37181
37181
|
deadLinks,
|
|
37182
37182
|
includes
|
|
37183
37183
|
};
|
|
37184
|
-
cache.set(src, result);
|
|
37184
|
+
cache$1.set(src, result);
|
|
37185
37185
|
return result;
|
|
37186
37186
|
};
|
|
37187
37187
|
}
|
|
@@ -40790,10 +40790,15 @@ async function bundle(config, options) {
|
|
|
40790
40790
|
preserveEntrySignatures: "allow-extension",
|
|
40791
40791
|
output: __spreadValues(__spreadValues({}, rollupOptions == null ? void 0 : rollupOptions.output), ssr ? {} : {
|
|
40792
40792
|
chunkFileNames(chunk) {
|
|
40793
|
-
|
|
40794
|
-
|
|
40793
|
+
return /(?:Carbon|BuySell)Ads/.test(chunk.name) ? `assets/chunks/ui-custom.[hash].js` : `assets/chunks/[name].[hash].js`;
|
|
40794
|
+
},
|
|
40795
|
+
manualChunks(id, ctx) {
|
|
40796
|
+
if (id.includes("plugin-vue:export-helper")) {
|
|
40797
|
+
return "framework";
|
|
40798
|
+
}
|
|
40799
|
+
if (isEagerChunk(id, ctx) && (/@vue\/(runtime|shared|reactivity)/.test(id) || /vitepress\/dist\/client/.test(id))) {
|
|
40800
|
+
return "framework";
|
|
40795
40801
|
}
|
|
40796
|
-
return adComponentRE.test(chunk.name) ? `assets/ui-custom.[hash].js` : `assets/[name].[hash].js`;
|
|
40797
40802
|
}
|
|
40798
40803
|
})
|
|
40799
40804
|
}),
|
|
@@ -40837,7 +40842,33 @@ async function bundle(config, options) {
|
|
|
40837
40842
|
}
|
|
40838
40843
|
return { clientResult, serverResult, pageToHashMap };
|
|
40839
40844
|
}
|
|
40840
|
-
const
|
|
40845
|
+
const cache = /* @__PURE__ */ new Map();
|
|
40846
|
+
function isEagerChunk(id, { getModuleInfo }) {
|
|
40847
|
+
if (id.includes("node_modules") && !/\.css($|\\?)/.test(id) && staticImportedByEntry(id, getModuleInfo, cache)) {
|
|
40848
|
+
return "vendor";
|
|
40849
|
+
}
|
|
40850
|
+
}
|
|
40851
|
+
function staticImportedByEntry(id, getModuleInfo, cache2, importStack = []) {
|
|
40852
|
+
if (cache2.has(id)) {
|
|
40853
|
+
return cache2.get(id);
|
|
40854
|
+
}
|
|
40855
|
+
if (importStack.includes(id)) {
|
|
40856
|
+
cache2.set(id, false);
|
|
40857
|
+
return false;
|
|
40858
|
+
}
|
|
40859
|
+
const mod = getModuleInfo(id);
|
|
40860
|
+
if (!mod) {
|
|
40861
|
+
cache2.set(id, false);
|
|
40862
|
+
return false;
|
|
40863
|
+
}
|
|
40864
|
+
if (mod.isEntry) {
|
|
40865
|
+
cache2.set(id, true);
|
|
40866
|
+
return true;
|
|
40867
|
+
}
|
|
40868
|
+
const someImporterIs = mod.importers.some((importer) => staticImportedByEntry(importer, getModuleInfo, cache2, importStack.concat(id)));
|
|
40869
|
+
cache2.set(id, someImporterIs);
|
|
40870
|
+
return someImporterIs;
|
|
40871
|
+
}
|
|
40841
40872
|
|
|
40842
40873
|
async function renderPage(config, page, result, appChunk, cssChunk, pageToHashMap, hashMapString) {
|
|
40843
40874
|
const { createApp } = require(path__default["default"].join(config.tempDir, `app.js`));
|