@slidev/cli 0.48.0-beta.3 → 0.48.0-beta.5

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.
@@ -2,9 +2,11 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-JORVSTMS.mjs";
6
- import "./chunk-CTBVOVLQ.mjs";
7
- import "./chunk-DWXI5WEO.mjs";
5
+ } from "./chunk-U44GKKNH.mjs";
6
+ import "./chunk-O6TYYGU6.mjs";
7
+ import {
8
+ findPkgRoot
9
+ } from "./chunk-7HOZGSL4.mjs";
8
10
  import "./chunk-BXO7ZPPU.mjs";
9
11
 
10
12
  // node/build.ts
@@ -56,33 +58,31 @@ async function build(options, viteConfig = {}, args) {
56
58
  console.log(yellow(" Monaco is disabled in the build, to enabled it, set `monaco: true` in the frontmatter"));
57
59
  } else {
58
60
  console.log(blue(" building for Monaco...\n"));
59
- await viteBuild(
60
- await mergeViteConfigs(
61
- options,
62
- inlineConfig,
63
- {
64
- root: join(options.clientRoot, "iframes/monaco"),
65
- base: `${config.base}iframes/monaco/`,
66
- build: {
67
- outDir: resolve(config.build.outDir, "iframes/monaco"),
68
- // fix for monaco workers
69
- // https://github.com/vitejs/vite/issues/1927#issuecomment-805803918
70
- rollupOptions: {
71
- output: {
72
- manualChunks: {
73
- jsonWorker: ["monaco-editor/esm/vs/language/json/json.worker"],
74
- cssWorker: ["monaco-editor/esm/vs/language/css/css.worker"],
75
- htmlWorker: ["monaco-editor/esm/vs/language/html/html.worker"],
76
- tsWorker: ["monaco-editor/esm/vs/language/typescript/ts.worker"],
77
- editorWorker: ["monaco-editor/esm/vs/editor/editor.worker"]
78
- }
79
- }
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")
80
81
  }
81
82
  }
82
- },
83
- "build"
84
- )
85
- );
83
+ }
84
+ }
85
+ });
86
86
  }
87
87
  }
88
88
  } finally {
@@ -98,7 +98,7 @@ async function build(options, viteConfig = {}, args) {
98
98
  await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
99
99
  `, "utf-8");
100
100
  if ([true, "true", "auto"].includes(options.data.config.download)) {
101
- const { exportSlides, getExportOptions } = await import("./export-MLH55TH5.mjs");
101
+ const { exportSlides, getExportOptions } = await import("./export-SM2ZATWB.mjs");
102
102
  const port = 12445;
103
103
  const app = connect();
104
104
  const server = http.createServer(app);