@slidev/cli 0.48.0-beta.15 → 0.48.0-beta.16
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-TYMPDPHA.mjs → build-BFCSVURA.mjs} +4 -39
- package/dist/{chunk-ESDR4XPY.mjs → chunk-6SJIO2WJ.mjs} +2 -2
- package/dist/{chunk-7HOZGSL4.mjs → chunk-G3BP3FUT.mjs} +0 -1
- package/dist/{chunk-HHZ7SVZP.mjs → chunk-TMXTXTYI.mjs} +1581 -1412
- package/dist/cli.mjs +6 -6
- package/dist/{export-SM2ZATWB.mjs → export-JD32O5W6.mjs} +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +5 -5
|
@@ -2,21 +2,18 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TMXTXTYI.mjs";
|
|
6
6
|
import "./chunk-O6TYYGU6.mjs";
|
|
7
|
-
import
|
|
8
|
-
findPkgRoot
|
|
9
|
-
} from "./chunk-7HOZGSL4.mjs";
|
|
7
|
+
import "./chunk-G3BP3FUT.mjs";
|
|
10
8
|
import "./chunk-BXO7ZPPU.mjs";
|
|
11
9
|
|
|
12
10
|
// node/build.ts
|
|
13
|
-
import {
|
|
11
|
+
import { resolve } from "node:path";
|
|
14
12
|
import http from "node:http";
|
|
15
13
|
import fs from "fs-extra";
|
|
16
14
|
import { mergeConfig, build as viteBuild } from "vite";
|
|
17
15
|
import connect from "connect";
|
|
18
16
|
import sirv from "sirv";
|
|
19
|
-
import { blue, yellow } from "kolorist";
|
|
20
17
|
async function build(options, viteConfig = {}, args) {
|
|
21
18
|
const indexPath = resolve(options.userRoot, "index.html");
|
|
22
19
|
let originalIndexHTML;
|
|
@@ -53,38 +50,6 @@ async function build(options, viteConfig = {}, args) {
|
|
|
53
50
|
}
|
|
54
51
|
);
|
|
55
52
|
await viteBuild(inlineConfig);
|
|
56
|
-
if (options.data.features.monaco) {
|
|
57
|
-
if (options.data.config.monaco === "dev") {
|
|
58
|
-
console.log(yellow(" Monaco is disabled in the build, to enabled it, set `monaco: true` in the frontmatter"));
|
|
59
|
-
} else {
|
|
60
|
-
console.log(blue(" building for Monaco...\n"));
|
|
61
|
-
const monacoRoot = await findPkgRoot("monaco-editor", options.clientRoot, true);
|
|
62
|
-
const getWorkerPath = (path) => [join(monacoRoot, "esm/vs", path)];
|
|
63
|
-
await viteBuild({
|
|
64
|
-
root: join(options.clientRoot, "iframes/monaco"),
|
|
65
|
-
base: `${config.base}iframes/monaco/`,
|
|
66
|
-
plugins: [
|
|
67
|
-
await ViteSlidevPlugin(options, inlineConfig.slidev || {})
|
|
68
|
-
],
|
|
69
|
-
build: {
|
|
70
|
-
outDir: resolve(options.userRoot, config.build.outDir, "iframes/monaco"),
|
|
71
|
-
// fix for monaco workers
|
|
72
|
-
// https://github.com/vitejs/vite/issues/1927#issuecomment-805803918
|
|
73
|
-
rollupOptions: {
|
|
74
|
-
output: {
|
|
75
|
-
manualChunks: {
|
|
76
|
-
jsonWorker: getWorkerPath("language/json/json.worker"),
|
|
77
|
-
cssWorker: getWorkerPath("language/css/css.worker"),
|
|
78
|
-
htmlWorker: getWorkerPath("language/html/html.worker"),
|
|
79
|
-
tsWorker: getWorkerPath("language/typescript/ts.worker"),
|
|
80
|
-
editorWorker: getWorkerPath("editor/editor.worker")
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
53
|
} finally {
|
|
89
54
|
if (originalIndexHTML != null)
|
|
90
55
|
await fs.writeFile(indexPath, originalIndexHTML, "utf-8");
|
|
@@ -98,7 +63,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
98
63
|
await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
99
64
|
`, "utf-8");
|
|
100
65
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
101
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
66
|
+
const { exportSlides, getExportOptions } = await import("./export-JD32O5W6.mjs");
|
|
102
67
|
const port = 12445;
|
|
103
68
|
const app = connect();
|
|
104
69
|
const server = http.createServer(app);
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
mergeViteConfigs,
|
|
5
5
|
require_semver,
|
|
6
6
|
version
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TMXTXTYI.mjs";
|
|
8
8
|
import {
|
|
9
9
|
createResolver,
|
|
10
10
|
getRoots,
|
|
11
11
|
resolveEntry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-G3BP3FUT.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__toESM
|
|
15
15
|
} from "./chunk-BXO7ZPPU.mjs";
|