@slidev/cli 0.38.4 → 0.38.7

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,7 +2,7 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-NTTNCVJU.mjs";
5
+ } from "./chunk-NOJBQ6MT.mjs";
6
6
  import {
7
7
  __require,
8
8
  __toESM,
@@ -648,7 +648,7 @@ function build_default(dir, opts = {}) {
648
648
 
649
649
  // node/build.ts
650
650
  import { blue, yellow } from "kolorist";
651
- async function build(options, viteConfig = {}) {
651
+ async function build(options, viteConfig = {}, args) {
652
652
  const indexPath = resolve3(options.userRoot, "index.html");
653
653
  const rawConfig = await resolveConfig({}, "build", options.entry);
654
654
  const pluginOptions = rawConfig.slidev || {};
@@ -718,14 +718,13 @@ async function build(options, viteConfig = {}) {
718
718
  await fs2.unlink(indexPath);
719
719
  }
720
720
  const outDir = resolve3(options.userRoot, config.build.outDir);
721
- const outFilename = options.data.config.exportFilename || "slidev-exported.pdf";
722
721
  await fs2.copyFile(resolve3(outDir, "index.html"), resolve3(outDir, "404.html"));
723
722
  const redirectsPath = resolve3(outDir, "_redirects");
724
723
  if (!fs2.existsSync(redirectsPath))
725
724
  await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
726
725
  `, "utf-8");
727
726
  if ([true, "true", "auto"].includes(options.data.config.download)) {
728
- const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-JGJTLG7B.mjs")));
727
+ const { exportSlides, getExportOptions } = await Promise.resolve().then(() => __toESM(__require("./export-LL3DLTJH.mjs")));
729
728
  const port = 12445;
730
729
  const app = connect();
731
730
  const server = http.createServer(app);
@@ -740,15 +739,8 @@ async function build(options, viteConfig = {}) {
740
739
  server.listen(port);
741
740
  await exportSlides({
742
741
  port,
743
- slides: options.data.slides,
744
- total: options.data.slides.length,
745
- format: "pdf",
746
- output: join3(outDir, outFilename),
747
742
  base: config.base,
748
- dark: options.data.config.colorSchema === "dark",
749
- width: options.data.config.canvasWidth,
750
- height: Math.round(options.data.config.canvasWidth / options.data.config.aspectRatio),
751
- routerMode: options.data.config.routerMode
743
+ ...getExportOptions(args, options, outDir, "slidev-exported.pdf")
752
744
  });
753
745
  server.close();
754
746
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkTXDYSJOBjs = require('./chunk-TXDYSJOB.js');
5
+ var _chunkHHR7Q56Zjs = require('./chunk-HHR7Q56Z.js');
6
6
 
7
7
 
8
8
 
@@ -648,23 +648,23 @@ function build_default(dir, opts = {}) {
648
648
 
649
649
  // node/build.ts
650
650
  var _kolorist = require('kolorist');
651
- async function build(options, viteConfig = {}) {
651
+ async function build(options, viteConfig = {}, args) {
652
652
  const indexPath = _path.resolve.call(void 0, options.userRoot, "index.html");
653
653
  const rawConfig = await _vite.resolveConfig.call(void 0, {}, "build", options.entry);
654
654
  const pluginOptions = rawConfig.slidev || {};
655
655
  let originalIndexHTML;
656
656
  if (_fsextra2.default.existsSync(indexPath))
657
657
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
658
- await _fsextra2.default.writeFile(indexPath, await _chunkTXDYSJOBjs.getIndexHtml.call(void 0, options), "utf-8");
658
+ await _fsextra2.default.writeFile(indexPath, await _chunkHHR7Q56Zjs.getIndexHtml.call(void 0, options), "utf-8");
659
659
  let config = void 0;
660
660
  try {
661
- const inlineConfig = await _chunkTXDYSJOBjs.mergeViteConfigs.call(void 0,
661
+ const inlineConfig = await _chunkHHR7Q56Zjs.mergeViteConfigs.call(void 0,
662
662
  options,
663
663
  viteConfig,
664
664
  {
665
665
  root: options.userRoot,
666
666
  plugins: [
667
- await _chunkTXDYSJOBjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
667
+ await _chunkHHR7Q56Zjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
668
668
  {
669
669
  name: "resolve-config",
670
670
  configResolved(_config) {
@@ -685,7 +685,7 @@ async function build(options, viteConfig = {}) {
685
685
  } else {
686
686
  console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
687
687
  await _vite.build.call(void 0,
688
- await _chunkTXDYSJOBjs.mergeViteConfigs.call(void 0,
688
+ await _chunkHHR7Q56Zjs.mergeViteConfigs.call(void 0,
689
689
  options,
690
690
  inlineConfig,
691
691
  {
@@ -718,14 +718,13 @@ async function build(options, viteConfig = {}) {
718
718
  await _fsextra2.default.unlink(indexPath);
719
719
  }
720
720
  const outDir = _path.resolve.call(void 0, options.userRoot, config.build.outDir);
721
- const outFilename = options.data.config.exportFilename || "slidev-exported.pdf";
722
721
  await _fsextra2.default.copyFile(_path.resolve.call(void 0, outDir, "index.html"), _path.resolve.call(void 0, outDir, "404.html"));
723
722
  const redirectsPath = _path.resolve.call(void 0, outDir, "_redirects");
724
723
  if (!_fsextra2.default.existsSync(redirectsPath))
725
724
  await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
726
725
  `, "utf-8");
727
726
  if ([true, "true", "auto"].includes(options.data.config.download)) {
728
- const { exportSlides } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-OIZT2CQS.js")));
727
+ const { exportSlides, getExportOptions } = await Promise.resolve().then(() => _chunkOVFYMGU6js.__toESM.call(void 0, _chunkOVFYMGU6js.__require.call(void 0, "./export-BWNX2QVG.js")));
729
728
  const port = 12445;
730
729
  const app = _connect2.default.call(void 0, );
731
730
  const server = _http2.default.createServer(app);
@@ -740,15 +739,8 @@ async function build(options, viteConfig = {}) {
740
739
  server.listen(port);
741
740
  await exportSlides({
742
741
  port,
743
- slides: options.data.slides,
744
- total: options.data.slides.length,
745
- format: "pdf",
746
- output: _path.join.call(void 0, outDir, outFilename),
747
742
  base: config.base,
748
- dark: options.data.config.colorSchema === "dark",
749
- width: options.data.config.canvasWidth,
750
- height: Math.round(options.data.config.canvasWidth / options.data.config.aspectRatio),
751
- routerMode: options.data.config.routerMode
743
+ ...getExportOptions(args, options, outDir, "slidev-exported.pdf")
752
744
  });
753
745
  server.close();
754
746
  }