@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.
- package/dist/{build-XB553JUF.mjs → build-2WSKFKOA.mjs} +4 -12
- package/dist/{build-ATIWLFVV.js → build-S6XIJ3EO.js} +8 -16
- package/dist/{chunk-CUQDKJBB.js → chunk-35GWFKPP.js} +518 -398
- package/dist/{chunk-LAZ5PNFJ.mjs → chunk-5HOW7RNS.mjs} +522 -402
- package/dist/{chunk-TXDYSJOB.js → chunk-HHR7Q56Z.js} +16 -11
- package/dist/{chunk-NTTNCVJU.mjs → chunk-NOJBQ6MT.mjs} +15 -10
- package/dist/cli.js +68 -94
- package/dist/cli.mjs +43 -69
- package/dist/{export-OIZT2CQS.js → export-BWNX2QVG.js} +67 -9
- package/dist/{export-JGJTLG7B.mjs → export-LL3DLTJH.mjs} +67 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +8 -6
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
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-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
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
|
-
|
|
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
|
}
|