@slidev/cli 0.27.13 → 0.27.17
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/{build-EAZGCU4K.mjs → build-3PYDYXWL.mjs} +5 -4
- package/dist/{build-63UO2WKL.js → build-DYELZSUV.js} +27 -26
- package/dist/{chunk-Y4U4HNBF.js → chunk-3QMXOBKW.js} +4 -4
- package/dist/{chunk-5CE4DP4R.mjs → chunk-6HK3HED2.mjs} +1 -1
- package/dist/{chunk-6GSA3UIY.js → chunk-7EYE5BOQ.js} +24 -3
- package/dist/{chunk-MJ3BO472.js → chunk-DVHCB7TL.js} +56 -55
- package/dist/{chunk-C2FOYGKS.mjs → chunk-L7QFSRQN.mjs} +4 -3
- package/dist/{chunk-YUEXXPFU.js → chunk-LJGOLBO3.js} +123 -118
- package/dist/{chunk-UHBOZECB.mjs → chunk-NIUZ32MT.mjs} +11 -6
- package/dist/{chunk-62N46WVW.mjs → chunk-QQD2JVXL.mjs} +23 -2
- package/dist/cli.js +19 -19
- package/dist/cli.mjs +6 -6
- package/dist/{export-FBGRGWZB.js → export-OUL6OBWA.js} +5 -5
- package/dist/{export-KVVXZJNX.mjs → export-P2HOWL7Q.mjs} +2 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -7
- package/dist/index.mjs +6 -4
- package/package.json +5 -4
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
var _chunk7EYE5BOQjs = require('./chunk-7EYE5BOQ.js');
|
|
13
14
|
|
|
14
15
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
15
|
-
var require_fast_deep_equal =
|
|
16
|
+
var require_fast_deep_equal = _chunk7EYE5BOQjs.__commonJS.call(void 0, {
|
|
16
17
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
17
|
-
|
|
18
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
18
19
|
"use strict";
|
|
19
20
|
module.exports = function equal2(a, b) {
|
|
20
21
|
if (a === b)
|
|
@@ -58,7 +59,7 @@ var require_fast_deep_equal = _chunk6GSA3UIYjs.__commonJS.call(void 0, {
|
|
|
58
59
|
});
|
|
59
60
|
|
|
60
61
|
// node/common.ts
|
|
61
|
-
|
|
62
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
62
63
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
63
64
|
var _path = require('path');
|
|
64
65
|
var _utils = require('@antfu/utils');
|
|
@@ -67,6 +68,7 @@ async function getIndexHtml({ clientRoot, themeRoots, data, userRoot }) {
|
|
|
67
68
|
let main = await _fs.promises.readFile(_path.join.call(void 0, clientRoot, "index.html"), "utf-8");
|
|
68
69
|
let head = "";
|
|
69
70
|
let body = "";
|
|
71
|
+
head += `<link rel="icon" href="${data.config.favicon}">`;
|
|
70
72
|
const roots = _utils.uniq.call(void 0, [
|
|
71
73
|
...themeRoots,
|
|
72
74
|
userRoot
|
|
@@ -85,13 +87,13 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
85
87
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
|
|
86
88
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
87
89
|
head += `
|
|
88
|
-
<link rel="stylesheet" href="${
|
|
89
|
-
main = main.replace("__ENTRY__",
|
|
90
|
+
<link rel="stylesheet" href="${_chunk7EYE5BOQjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunk7EYE5BOQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
90
92
|
return main;
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
// node/plugins/windicss.ts
|
|
94
|
-
|
|
96
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
95
97
|
|
|
96
98
|
|
|
97
99
|
|
|
@@ -99,13 +101,13 @@ var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindic
|
|
|
99
101
|
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
100
102
|
|
|
101
103
|
// node/plugins/setupNode.ts
|
|
102
|
-
|
|
104
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
103
105
|
|
|
104
106
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
105
107
|
|
|
106
108
|
|
|
107
109
|
function deepMerge(a, b, rootPath = "") {
|
|
108
|
-
a =
|
|
110
|
+
a = _chunk7EYE5BOQjs.__spreadValues.call(void 0, {}, a);
|
|
109
111
|
Object.keys(b).forEach((key) => {
|
|
110
112
|
if (_utils.isObject.call(void 0, a[key]))
|
|
111
113
|
a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
|
|
@@ -143,7 +145,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
143
145
|
if (config.default)
|
|
144
146
|
config = config.default;
|
|
145
147
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
146
|
-
return _vitepluginwindicss2.default.call(void 0,
|
|
148
|
+
return _vitepluginwindicss2.default.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
147
149
|
configFiles: [configFile],
|
|
148
150
|
config,
|
|
149
151
|
onConfigResolved(config2) {
|
|
@@ -165,15 +167,15 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
165
167
|
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
166
168
|
});
|
|
167
169
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
168
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
169
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
170
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
170
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk7EYE5BOQjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
171
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk7EYE5BOQjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
172
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk7EYE5BOQjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
171
173
|
}
|
|
172
174
|
}, windiOptions));
|
|
173
175
|
}
|
|
174
176
|
|
|
175
177
|
// node/plugins/preset.ts
|
|
176
|
-
|
|
178
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
177
179
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
178
180
|
var _vite = require('unplugin-icons/vite'); var _vite2 = _interopRequireDefault(_vite);
|
|
179
181
|
var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
|
|
@@ -183,7 +185,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
183
185
|
|
|
184
186
|
|
|
185
187
|
// node/drawings.ts
|
|
186
|
-
|
|
188
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
187
189
|
|
|
188
190
|
|
|
189
191
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -229,11 +231,10 @@ ${value}
|
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
// node/plugins/extendConfig.ts
|
|
232
|
-
|
|
234
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
233
235
|
|
|
234
236
|
var _vite5 = require('vite');
|
|
235
237
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
236
|
-
var _resolveglobal = require('resolve-global'); var _resolveglobal2 = _interopRequireDefault(_resolveglobal);
|
|
237
238
|
|
|
238
239
|
|
|
239
240
|
// ../client/package.json
|
|
@@ -263,7 +264,7 @@ var dependencies = {
|
|
|
263
264
|
};
|
|
264
265
|
|
|
265
266
|
// node/vite/searchRoot.ts
|
|
266
|
-
|
|
267
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
267
268
|
|
|
268
269
|
|
|
269
270
|
var ROOT_FILES = [
|
|
@@ -323,7 +324,7 @@ function createConfigPlugin(options) {
|
|
|
323
324
|
define: getDefine(options),
|
|
324
325
|
resolve: {
|
|
325
326
|
alias: {
|
|
326
|
-
"@slidev/client/": `${
|
|
327
|
+
"@slidev/client/": `${_chunk7EYE5BOQjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
327
328
|
}
|
|
328
329
|
},
|
|
329
330
|
optimizeDeps: {
|
|
@@ -349,7 +350,7 @@ function createConfigPlugin(options) {
|
|
|
349
350
|
allow: _utils.uniq.call(void 0, [
|
|
350
351
|
searchForWorkspaceRoot(options.userRoot),
|
|
351
352
|
searchForWorkspaceRoot(options.cliRoot),
|
|
352
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
353
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunk7EYE5BOQjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunk7EYE5BOQjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
353
354
|
])
|
|
354
355
|
}
|
|
355
356
|
}
|
|
@@ -358,7 +359,7 @@ function createConfigPlugin(options) {
|
|
|
358
359
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
359
360
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
360
361
|
injection.root = options.cliRoot;
|
|
361
|
-
injection.resolve.alias.vue = `${
|
|
362
|
+
injection.resolve.alias.vue = `${_chunk7EYE5BOQjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
362
363
|
}
|
|
363
364
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
364
365
|
},
|
|
@@ -379,7 +380,7 @@ function createConfigPlugin(options) {
|
|
|
379
380
|
}
|
|
380
381
|
function getDefine(options) {
|
|
381
382
|
return {
|
|
382
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
383
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunk7EYE5BOQjs.toAtFS.call(void 0, options.clientRoot)),
|
|
383
384
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
384
385
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
385
386
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -388,8 +389,8 @@ function getDefine(options) {
|
|
|
388
389
|
}
|
|
389
390
|
|
|
390
391
|
// node/plugins/loaders.ts
|
|
391
|
-
|
|
392
|
-
var import_fast_deep_equal =
|
|
392
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
393
|
+
var import_fast_deep_equal = _chunk7EYE5BOQjs.__toModule.call(void 0, require_fast_deep_equal());
|
|
393
394
|
|
|
394
395
|
|
|
395
396
|
|
|
@@ -426,7 +427,7 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
426
427
|
}
|
|
427
428
|
});
|
|
428
429
|
function prepareSlideInfo(data) {
|
|
429
|
-
return
|
|
430
|
+
return _chunk7EYE5BOQjs.__spreadProps.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {}, data), {
|
|
430
431
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
431
432
|
});
|
|
432
433
|
}
|
|
@@ -515,7 +516,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
515
516
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
516
517
|
try {
|
|
517
518
|
const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
518
|
-
return await VuePlugin.handleHotUpdate(
|
|
519
|
+
return await VuePlugin.handleHotUpdate(_chunk7EYE5BOQjs.__spreadProps.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {}, ctx), {
|
|
519
520
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
520
521
|
file,
|
|
521
522
|
read() {
|
|
@@ -597,13 +598,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
597
598
|
async function transformMarkdown(code, pageNo, data2) {
|
|
598
599
|
var _a, _b;
|
|
599
600
|
const layouts = await getLayouts();
|
|
600
|
-
const frontmatter =
|
|
601
|
+
const frontmatter = _chunk7EYE5BOQjs.__spreadValues.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
601
602
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
602
603
|
if (!layouts[layoutName])
|
|
603
604
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
604
605
|
delete frontmatter.title;
|
|
605
606
|
const imports = [
|
|
606
|
-
`import InjectedLayout from "${
|
|
607
|
+
`import InjectedLayout from "${_chunk7EYE5BOQjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
607
608
|
`const frontmatter = ${JSON.stringify(frontmatter)}`
|
|
608
609
|
];
|
|
609
610
|
code = code.replace(/(<script setup.*>)/g, `$1
|
|
@@ -649,9 +650,9 @@ ${code.slice(injectB)}`;
|
|
|
649
650
|
}
|
|
650
651
|
async function generateUserStyles() {
|
|
651
652
|
const imports = [
|
|
652
|
-
`import "${
|
|
653
|
-
`import "${
|
|
654
|
-
`import "${
|
|
653
|
+
`import "${_chunk7EYE5BOQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
654
|
+
`import "${_chunk7EYE5BOQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
655
|
+
`import "${_chunk7EYE5BOQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
655
656
|
];
|
|
656
657
|
const roots2 = _utils.uniq.call(void 0, [
|
|
657
658
|
...themeRoots,
|
|
@@ -667,13 +668,13 @@ ${code.slice(injectB)}`;
|
|
|
667
668
|
];
|
|
668
669
|
for (const style of styles) {
|
|
669
670
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
670
|
-
imports.push(`import "${
|
|
671
|
+
imports.push(`import "${_chunk7EYE5BOQjs.toAtFS.call(void 0, style)}"`);
|
|
671
672
|
continue;
|
|
672
673
|
}
|
|
673
674
|
}
|
|
674
675
|
}
|
|
675
676
|
if (data.features.katex)
|
|
676
|
-
imports.push(`import "${
|
|
677
|
+
imports.push(`import "${_chunk7EYE5BOQjs.toAtFS.call(void 0, _chunk7EYE5BOQjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
677
678
|
return imports.join("\n");
|
|
678
679
|
}
|
|
679
680
|
async function generateMonacoTypes() {
|
|
@@ -682,7 +683,7 @@ ${code.slice(injectB)}`;
|
|
|
682
683
|
async function generateLayouts() {
|
|
683
684
|
const imports = [];
|
|
684
685
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
685
|
-
imports.push(`import __layout_${k} from "${
|
|
686
|
+
imports.push(`import __layout_${k} from "${_chunk7EYE5BOQjs.toAtFS.call(void 0, v)}"`);
|
|
686
687
|
return [k, `__layout_${k}`];
|
|
687
688
|
});
|
|
688
689
|
return [
|
|
@@ -728,10 +729,10 @@ ${routes.join(",\n")}
|
|
|
728
729
|
return [...imports, routesStr].join("\n");
|
|
729
730
|
}
|
|
730
731
|
function generateConfigs() {
|
|
731
|
-
const config =
|
|
732
|
+
const config = _chunk7EYE5BOQjs.__spreadValues.call(void 0, {}, data.config);
|
|
732
733
|
if (_utils.isString.call(void 0, config.title)) {
|
|
733
734
|
const tokens = md.parseInline(config.title, {});
|
|
734
|
-
config.title =
|
|
735
|
+
config.title = _chunk7EYE5BOQjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
735
736
|
}
|
|
736
737
|
if (_utils.isString.call(void 0, config.info))
|
|
737
738
|
config.info = md.render(config.info);
|
|
@@ -752,7 +753,7 @@ ${routes.join(",\n")}
|
|
|
752
753
|
];
|
|
753
754
|
}
|
|
754
755
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
755
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
756
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunk7EYE5BOQjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
756
757
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
757
758
|
return `
|
|
758
759
|
${imports}
|
|
@@ -767,7 +768,7 @@ export default {
|
|
|
767
768
|
}
|
|
768
769
|
|
|
769
770
|
// node/plugins/monacoTransform.ts
|
|
770
|
-
|
|
771
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
771
772
|
|
|
772
773
|
|
|
773
774
|
|
|
@@ -801,7 +802,7 @@ function createMonacoTypesLoader() {
|
|
|
801
802
|
}
|
|
802
803
|
|
|
803
804
|
// node/plugins/setupClient.ts
|
|
804
|
-
|
|
805
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
805
806
|
|
|
806
807
|
|
|
807
808
|
|
|
@@ -823,7 +824,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
823
824
|
setups.forEach((path, idx) => {
|
|
824
825
|
if (!_fs.existsSync.call(void 0, path))
|
|
825
826
|
return;
|
|
826
|
-
imports.push(`import __n${idx} from '${
|
|
827
|
+
imports.push(`import __n${idx} from '${_chunk7EYE5BOQjs.toAtFS.call(void 0, path)}'`);
|
|
827
828
|
let fn = `__n${idx}`;
|
|
828
829
|
let awaitFn = `await __n${idx}`;
|
|
829
830
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -851,7 +852,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
851
852
|
}
|
|
852
853
|
|
|
853
854
|
// node/plugins/markdown.ts
|
|
854
|
-
|
|
855
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
855
856
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
856
857
|
var _jsbase64 = require('js-base64'); var _jsbase642 = _interopRequireDefault(_jsbase64);
|
|
857
858
|
|
|
@@ -861,7 +862,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
861
862
|
var _plantumlencoder = require('plantuml-encoder');
|
|
862
863
|
|
|
863
864
|
// node/plugins/markdown-it-katex.ts
|
|
864
|
-
|
|
865
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
865
866
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
866
867
|
function isValidDelim(state, pos) {
|
|
867
868
|
const max = state.posMax;
|
|
@@ -1008,7 +1009,7 @@ function math_plugin(md2, options) {
|
|
|
1008
1009
|
}
|
|
1009
1010
|
|
|
1010
1011
|
// node/plugins/markdown-it-prism.ts
|
|
1011
|
-
|
|
1012
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
1012
1013
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1013
1014
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1014
1015
|
var DEFAULTS = {
|
|
@@ -1031,7 +1032,7 @@ function loadPrismLang(lang) {
|
|
|
1031
1032
|
}
|
|
1032
1033
|
function loadPrismPlugin(name) {
|
|
1033
1034
|
try {
|
|
1034
|
-
|
|
1035
|
+
_chunk7EYE5BOQjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1035
1036
|
} catch (e) {
|
|
1036
1037
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1037
1038
|
}
|
|
@@ -1071,7 +1072,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1071
1072
|
}
|
|
1072
1073
|
|
|
1073
1074
|
// node/plugins/markdown-it-shiki.ts
|
|
1074
|
-
|
|
1075
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
1075
1076
|
function getThemeName(theme) {
|
|
1076
1077
|
if (typeof theme === "string")
|
|
1077
1078
|
return theme;
|
|
@@ -1093,7 +1094,7 @@ function resolveShikiOptions(options) {
|
|
|
1093
1094
|
themes.push(options.theme);
|
|
1094
1095
|
}
|
|
1095
1096
|
}
|
|
1096
|
-
return
|
|
1097
|
+
return _chunk7EYE5BOQjs.__spreadProps.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {}, options), {
|
|
1097
1098
|
themes,
|
|
1098
1099
|
darkModeThemes: darkModeThemes ? {
|
|
1099
1100
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1131,7 +1132,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1131
1132
|
const setups = [];
|
|
1132
1133
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1133
1134
|
if (config.highlighter === "shiki") {
|
|
1134
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1135
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunk7EYE5BOQjs.__toModule.call(void 0, _chunk7EYE5BOQjs.__require.call(void 0, "shiki")));
|
|
1135
1136
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1136
1137
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1137
1138
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1140,11 +1141,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1140
1141
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1141
1142
|
}
|
|
1142
1143
|
const KatexOptions2 = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1143
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1144
|
+
return _vitepluginmd2.default.call(void 0, _chunk7EYE5BOQjs.__spreadProps.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
1144
1145
|
wrapperClasses: "",
|
|
1145
1146
|
headEnabled: false,
|
|
1146
1147
|
frontmatter: false,
|
|
1147
|
-
markdownItOptions:
|
|
1148
|
+
markdownItOptions: _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
1148
1149
|
quotes: `""''`,
|
|
1149
1150
|
html: true,
|
|
1150
1151
|
xhtmlOut: true,
|
|
@@ -1281,7 +1282,7 @@ function escapeVueInCode(md2) {
|
|
|
1281
1282
|
}
|
|
1282
1283
|
|
|
1283
1284
|
// node/plugins/patchTransform.ts
|
|
1284
|
-
|
|
1285
|
+
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
1285
1286
|
|
|
1286
1287
|
function createFixPlugins(options) {
|
|
1287
1288
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1335,10 +1336,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1335
1336
|
clientRoot,
|
|
1336
1337
|
data: { config }
|
|
1337
1338
|
} = options;
|
|
1338
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1339
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
1339
1340
|
include: [/\.vue$/, /\.md$/],
|
|
1340
1341
|
exclude: [],
|
|
1341
|
-
template:
|
|
1342
|
+
template: _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
1342
1343
|
compilerOptions: {
|
|
1343
1344
|
isCustomElement(tag) {
|
|
1344
1345
|
return customElements.has(tag);
|
|
@@ -1353,7 +1354,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1353
1354
|
MarkdownPlugin,
|
|
1354
1355
|
VuePlugin,
|
|
1355
1356
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1356
|
-
_vite4.default.call(void 0,
|
|
1357
|
+
_vite4.default.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
1357
1358
|
extensions: ["vue", "md", "ts"],
|
|
1358
1359
|
dirs: [
|
|
1359
1360
|
`${clientRoot}/builtin`,
|
|
@@ -1371,11 +1372,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1371
1372
|
})
|
|
1372
1373
|
]
|
|
1373
1374
|
}, componentsOptions)),
|
|
1374
|
-
_vite2.default.call(void 0,
|
|
1375
|
+
_vite2.default.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
1375
1376
|
defaultClass: "slidev-icon",
|
|
1376
1377
|
autoInstall: true
|
|
1377
1378
|
}, iconsOptions)),
|
|
1378
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1379
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunk7EYE5BOQjs.__spreadValues.call(void 0, {
|
|
1379
1380
|
rules: [
|
|
1380
1381
|
..._vitepluginremoteassets.DefaultRules,
|
|
1381
1382
|
{
|
|
@@ -5,10 +5,11 @@ import {
|
|
|
5
5
|
__spreadValues,
|
|
6
6
|
__toModule,
|
|
7
7
|
generateGoogleFontsUrl,
|
|
8
|
+
resolveGlobalImportPath,
|
|
8
9
|
resolveImportPath,
|
|
9
10
|
stringifyMarkdownTokens,
|
|
10
11
|
toAtFS
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QQD2JVXL.mjs";
|
|
12
13
|
|
|
13
14
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
14
15
|
var require_fast_deep_equal = __commonJS({
|
|
@@ -64,6 +65,7 @@ async function getIndexHtml({ clientRoot, themeRoots, data, userRoot }) {
|
|
|
64
65
|
let main = await fs.readFile(join(clientRoot, "index.html"), "utf-8");
|
|
65
66
|
let head = "";
|
|
66
67
|
let body = "";
|
|
68
|
+
head += `<link rel="icon" href="${data.config.favicon}">`;
|
|
67
69
|
const roots = uniq([
|
|
68
70
|
...themeRoots,
|
|
69
71
|
userRoot
|
|
@@ -225,7 +227,6 @@ ${value}
|
|
|
225
227
|
import { dirname as dirname4, join as join4 } from "path";
|
|
226
228
|
import { mergeConfig } from "vite";
|
|
227
229
|
import isInstalledGlobally from "is-installed-globally";
|
|
228
|
-
import resolveGlobal from "resolve-global";
|
|
229
230
|
import { uniq as uniq3 } from "@antfu/utils";
|
|
230
231
|
|
|
231
232
|
// ../client/package.json
|
|
@@ -340,7 +341,7 @@ function createConfigPlugin(options) {
|
|
|
340
341
|
allow: uniq3([
|
|
341
342
|
searchForWorkspaceRoot(options.userRoot),
|
|
342
343
|
searchForWorkspaceRoot(options.cliRoot),
|
|
343
|
-
...isInstalledGlobally ? [dirname4(
|
|
344
|
+
...isInstalledGlobally ? [dirname4(resolveGlobalImportPath("@slidev/client/package.json")), dirname4(resolveGlobalImportPath("katex/package.json"))] : []
|
|
344
345
|
])
|
|
345
346
|
}
|
|
346
347
|
}
|