@slidev/cli 0.40.16 → 0.41.0

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 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkUL7Y3R6Sjs = require('./chunk-UL7Y3R6S.js');
5
+ var _chunkUJUM4LW4js = require('./chunk-UJUM4LW4.js');
6
6
  require('./chunk-GE7W2DBE.js');
7
7
 
8
8
  // node/build.ts
@@ -12,7 +12,7 @@ var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsex
12
12
  var _vite = require('vite');
13
13
  var _connect = require('connect'); var _connect2 = _interopRequireDefault(_connect);
14
14
 
15
- // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
15
+ // ../../node_modules/.pnpm/sirv@2.0.3/node_modules/sirv/build.mjs
16
16
  var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
17
17
 
18
18
 
@@ -468,7 +468,7 @@ function lookup(extn) {
468
468
  return mimes[!~idx ? tmp : tmp.substring(++idx)];
469
469
  }
470
470
 
471
- // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
471
+ // ../../node_modules/.pnpm/sirv@2.0.3/node_modules/sirv/build.mjs
472
472
  var noop = () => {
473
473
  };
474
474
  function isMatch(uri, arr) {
@@ -532,7 +532,10 @@ function send(req, res, file, stats, headers) {
532
532
  let [x, y] = req.headers.range.replace("bytes=", "").split("-");
533
533
  let end = opts.end = parseInt(y, 10) || stats.size - 1;
534
534
  let start = opts.start = parseInt(x, 10) || 0;
535
- if (start >= stats.size || end >= stats.size) {
535
+ if (end >= stats.size) {
536
+ end = stats.size - 1;
537
+ }
538
+ if (start >= stats.size) {
536
539
  res.setHeader("Content-Range", `bytes */${stats.size}`);
537
540
  res.statusCode = 416;
538
541
  return res.end();
@@ -618,7 +621,7 @@ function build_default(dir, opts = {}) {
618
621
  extns.push(...extensions);
619
622
  if (pathname.indexOf("%") !== -1) {
620
623
  try {
621
- pathname = decodeURIComponent(pathname);
624
+ pathname = decodeURI(pathname);
622
625
  } catch (err) {
623
626
  }
624
627
  }
@@ -646,16 +649,16 @@ async function build(options, viteConfig = {}, args) {
646
649
  let originalIndexHTML;
647
650
  if (_fsextra2.default.existsSync(indexPath))
648
651
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
649
- await _fsextra2.default.writeFile(indexPath, await _chunkUL7Y3R6Sjs.getIndexHtml.call(void 0, options), "utf-8");
652
+ await _fsextra2.default.writeFile(indexPath, await _chunkUJUM4LW4js.getIndexHtml.call(void 0, options), "utf-8");
650
653
  let config = void 0;
651
654
  try {
652
- const inlineConfig = await _chunkUL7Y3R6Sjs.mergeViteConfigs.call(void 0,
655
+ const inlineConfig = await _chunkUJUM4LW4js.mergeViteConfigs.call(void 0,
653
656
  options,
654
657
  viteConfig,
655
658
  {
656
659
  root: options.userRoot,
657
660
  plugins: [
658
- await _chunkUL7Y3R6Sjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
661
+ await _chunkUJUM4LW4js.ViteSlidevPlugin.call(void 0, options, pluginOptions),
659
662
  {
660
663
  name: "resolve-config",
661
664
  configResolved(_config) {
@@ -676,7 +679,7 @@ async function build(options, viteConfig = {}, args) {
676
679
  } else {
677
680
  console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
678
681
  await _vite.build.call(void 0,
679
- await _chunkUL7Y3R6Sjs.mergeViteConfigs.call(void 0,
682
+ await _chunkUJUM4LW4js.mergeViteConfigs.call(void 0,
680
683
  options,
681
684
  inlineConfig,
682
685
  {
@@ -2,7 +2,7 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-AZNSOTRG.mjs";
5
+ } from "./chunk-AV6T2PNJ.mjs";
6
6
  import "./chunk-CTG3GV2W.mjs";
7
7
 
8
8
  // node/build.ts
@@ -12,7 +12,7 @@ import fs2 from "fs-extra";
12
12
  import { resolveConfig, build as viteBuild } from "vite";
13
13
  import connect from "connect";
14
14
 
15
- // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
15
+ // ../../node_modules/.pnpm/sirv@2.0.3/node_modules/sirv/build.mjs
16
16
  import * as fs from "fs";
17
17
  import { join as join2, normalize, resolve as resolve2 } from "path";
18
18
 
@@ -468,7 +468,7 @@ function lookup(extn) {
468
468
  return mimes[!~idx ? tmp : tmp.substring(++idx)];
469
469
  }
470
470
 
471
- // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
471
+ // ../../node_modules/.pnpm/sirv@2.0.3/node_modules/sirv/build.mjs
472
472
  var noop = () => {
473
473
  };
474
474
  function isMatch(uri, arr) {
@@ -532,7 +532,10 @@ function send(req, res, file, stats, headers) {
532
532
  let [x, y] = req.headers.range.replace("bytes=", "").split("-");
533
533
  let end = opts.end = parseInt(y, 10) || stats.size - 1;
534
534
  let start = opts.start = parseInt(x, 10) || 0;
535
- if (start >= stats.size || end >= stats.size) {
535
+ if (end >= stats.size) {
536
+ end = stats.size - 1;
537
+ }
538
+ if (start >= stats.size) {
536
539
  res.setHeader("Content-Range", `bytes */${stats.size}`);
537
540
  res.statusCode = 416;
538
541
  return res.end();
@@ -618,7 +621,7 @@ function build_default(dir, opts = {}) {
618
621
  extns.push(...extensions);
619
622
  if (pathname.indexOf("%") !== -1) {
620
623
  try {
621
- pathname = decodeURIComponent(pathname);
624
+ pathname = decodeURI(pathname);
622
625
  } catch (err) {
623
626
  }
624
627
  }