vite 2.9.12 → 2.9.13

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.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./dep-8f5c9290.js');
3
+ var index = require('./dep-80fe9c6b.js');
4
4
  var require$$1 = require('crypto');
5
5
  require('fs');
6
6
  require('path');
@@ -36554,7 +36554,7 @@ const assetAttrsConfig = {
36554
36554
  const isAsyncScriptMap = new WeakMap();
36555
36555
  async function traverseHtml(html, filePath, visitor) {
36556
36556
  // lazy load compiler
36557
- const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-985abbbd.js'); }).then(function (n) { return n.compilerDom_cjs; });
36557
+ const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-e66f37a9.js'); }).then(function (n) { return n.compilerDom_cjs; });
36558
36558
  // @vue/compiler-core doesn't like lowercase doctypes
36559
36559
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
36560
36560
  try {
@@ -37604,7 +37604,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
37604
37604
  replacer: urlReplacer
37605
37605
  }));
37606
37606
  if (isModule) {
37607
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-b27bdd3c.js'); }).then(function (n) { return n.index; })).default({
37607
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-e3eda1c7.js'); }).then(function (n) { return n.index; })).default({
37608
37608
  ...modulesOptions,
37609
37609
  getJSON(cssFileName, _modules, outputFileName) {
37610
37610
  modules = _modules;
@@ -48163,7 +48163,7 @@ async function getCertificate(cacheDir) {
48163
48163
  return content;
48164
48164
  }
48165
48165
  catch {
48166
- const content = (await Promise.resolve().then(function () { return require('./dep-ad22985c.js'); })).createCertificate();
48166
+ const content = (await Promise.resolve().then(function () { return require('./dep-56de50fc.js'); })).createCertificate();
48167
48167
  fs$n.promises
48168
48168
  .mkdir(cacheDir, { recursive: true })
48169
48169
  .then(() => fs$n.promises.writeFile(cachePath, content))
@@ -49750,7 +49750,7 @@ function serveStaticMiddleware(dir, server) {
49750
49750
  isInternalRequest(req.url)) {
49751
49751
  return next();
49752
49752
  }
49753
- const url = decodeURI(req.url);
49753
+ const url = decodeURIComponent(req.url);
49754
49754
  // apply aliases to static requests as well
49755
49755
  let redirected;
49756
49756
  for (const { find, replacement } of server.config.resolve.alias) {
@@ -49784,7 +49784,7 @@ function serveRawFsMiddleware(server) {
49784
49784
  const serveFromRoot = sirv('/', sirvOptions(server.config.server.headers));
49785
49785
  // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
49786
49786
  return function viteServeRawFsMiddleware(req, res, next) {
49787
- let url = decodeURI(req.url);
49787
+ let url = decodeURIComponent(req.url);
49788
49788
  // In some cases (e.g. linked monorepos) files outside of root will
49789
49789
  // reference assets that are also out of served root. In such cases
49790
49790
  // the paths are rewritten to `/@fs/` prefixed paths and must be served by
@@ -60803,11 +60803,21 @@ const wasmHelperId = '/__vite-wasm-helper';
60803
60803
  const wasmHelper = async (opts = {}, url) => {
60804
60804
  let result;
60805
60805
  if (url.startsWith('data:')) {
60806
- // @ts-ignore
60807
- const binaryString = atob(url.replace(/^data:.*?base64,/, ''));
60808
- const bytes = new Uint8Array(binaryString.length);
60809
- for (let i = 0; i < binaryString.length; i++) {
60810
- bytes[i] = binaryString.charCodeAt(i);
60806
+ const urlContent = url.replace(/^data:.*?base64,/, '');
60807
+ let bytes;
60808
+ if (typeof Buffer === 'function' && typeof Buffer.from === 'function') {
60809
+ bytes = Buffer.from(urlContent, 'base64');
60810
+ }
60811
+ else if (typeof atob === 'function') {
60812
+ // @ts-ignore
60813
+ const binaryString = atob(urlContent);
60814
+ bytes = new Uint8Array(binaryString.length);
60815
+ for (let i = 0; i < binaryString.length; i++) {
60816
+ bytes[i] = binaryString.charCodeAt(i);
60817
+ }
60818
+ }
60819
+ else {
60820
+ throw new Error('Failed to decode base64-encoded data URL, Buffer and atob are not supported');
60811
60821
  }
60812
60822
  // @ts-ignore
60813
60823
  result = await WebAssembly.instantiate(bytes, opts);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0 = require('postcss');
4
- var index$1 = require('./dep-8f5c9290.js');
4
+ var index$1 = require('./dep-80fe9c6b.js');
5
5
  var path$2 = require('path');
6
6
  var require$$1 = require('crypto');
7
7
  var fs = require('fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./dep-8f5c9290.js');
3
+ var index = require('./dep-80fe9c6b.js');
4
4
 
5
5
  function _mergeNamespaces(n, m) {
6
6
  for (var i = 0; i < m.length; i++) {
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var perf_hooks = require('perf_hooks');
4
4
  var require$$0 = require('events');
5
- var index = require('./chunks/dep-8f5c9290.js');
5
+ var index = require('./chunks/dep-80fe9c6b.js');
6
6
  require('fs');
7
7
  require('path');
8
8
  require('url');
@@ -683,7 +683,7 @@ cli
683
683
  .action(async (root, options) => {
684
684
  // output structure is preserved even after bundling so require()
685
685
  // is ok here
686
- const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-8f5c9290.js'); }).then(function (n) { return n.index$1; });
686
+ const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-80fe9c6b.js'); }).then(function (n) { return n.index$1; });
687
687
  try {
688
688
  const server = await createServer({
689
689
  root,
@@ -732,7 +732,7 @@ cli
732
732
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
733
733
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
734
734
  .action(async (root, options) => {
735
- const { build } = await Promise.resolve().then(function () { return require('./chunks/dep-8f5c9290.js'); }).then(function (n) { return n.build$1; });
735
+ const { build } = await Promise.resolve().then(function () { return require('./chunks/dep-80fe9c6b.js'); }).then(function (n) { return n.build$1; });
736
736
  const buildOptions = cleanOptions(options);
737
737
  try {
738
738
  await build({
@@ -755,7 +755,7 @@ cli
755
755
  .command('optimize [root]', 'pre-bundle dependencies')
756
756
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
757
757
  .action(async (root, options) => {
758
- const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-8f5c9290.js'); }).then(function (n) { return n.index; });
758
+ const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-80fe9c6b.js'); }).then(function (n) { return n.index; });
759
759
  try {
760
760
  const config = await index.resolveConfig({
761
761
  root,
@@ -778,7 +778,7 @@ cli
778
778
  .option('--https', `[boolean] use TLS + HTTP/2`)
779
779
  .option('--open [path]', `[boolean | string] open browser on startup`)
780
780
  .action(async (root, options) => {
781
- const { preview } = await Promise.resolve().then(function () { return require('./chunks/dep-8f5c9290.js'); }).then(function (n) { return n.preview$1; });
781
+ const { preview } = await Promise.resolve().then(function () { return require('./chunks/dep-80fe9c6b.js'); }).then(function (n) { return n.preview$1; });
782
782
  try {
783
783
  const server = await preview({
784
784
  root,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./chunks/dep-8f5c9290.js');
5
+ var index = require('./chunks/dep-80fe9c6b.js');
6
6
  require('fs');
7
7
  require('path');
8
8
  require('url');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "2.9.12",
3
+ "version": "2.9.13",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",