vite 2.7.10 → 2.7.11

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.

@@ -20397,7 +20397,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
20397
20397
  replacer: urlReplacer
20398
20398
  }));
20399
20399
  if (isModule) {
20400
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-be90506c.js'); }).then(function (n) { return n.index; })).default({
20400
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-03a0dd3b.js'); }).then(function (n) { return n.index; })).default({
20401
20401
  ...modulesOptions,
20402
20402
  getJSON(cssFileName, _modules, outputFileName) {
20403
20403
  modules = _modules;
@@ -21402,7 +21402,7 @@ const assetAttrsConfig = {
21402
21402
  const isAsyncScriptMap = new WeakMap();
21403
21403
  async function traverseHtml(html, filePath, visitor) {
21404
21404
  // lazy load compiler
21405
- const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-6899098c.js'); }).then(function (n) { return n.compilerDom_cjs; });
21405
+ const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-81908534.js'); }).then(function (n) { return n.compilerDom_cjs; });
21406
21406
  // @vue/compiler-core doesn't like lowercase doctypes
21407
21407
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
21408
21408
  try {
@@ -43719,7 +43719,7 @@ function readFileIfExists(value) {
43719
43719
  * https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
43720
43720
  */
43721
43721
  async function createCertificate() {
43722
- const { generate } = await Promise.resolve().then(function () { return require('./dep-5a0fbe99.js'); }).then(function (n) { return n.index; });
43722
+ const { generate } = await Promise.resolve().then(function () { return require('./dep-eba23f6c.js'); }).then(function (n) { return n.index; });
43723
43723
  const pems = generate(null, {
43724
43724
  algorithm: 'sha256',
43725
43725
  days: 30,
@@ -50943,6 +50943,37 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
50943
50943
  function isInScope(name, parents) {
50944
50944
  return parents.some((node) => { var _a; return node && ((_a = scopeMap.get(node)) === null || _a === void 0 ? void 0 : _a.has(name)); });
50945
50945
  }
50946
+ function handlePattern(p, parentFunction) {
50947
+ if (p.type === 'Identifier') {
50948
+ setScope(parentFunction, p.name);
50949
+ }
50950
+ else if (p.type === 'RestElement') {
50951
+ handlePattern(p.argument, parentFunction);
50952
+ }
50953
+ else if (p.type === 'ObjectPattern') {
50954
+ p.properties.forEach((property) => {
50955
+ if (property.type === 'RestElement') {
50956
+ setScope(parentFunction, property.argument.name);
50957
+ }
50958
+ else {
50959
+ handlePattern(property.value, parentFunction);
50960
+ }
50961
+ });
50962
+ }
50963
+ else if (p.type === 'ArrayPattern') {
50964
+ p.elements.forEach((element) => {
50965
+ if (element) {
50966
+ handlePattern(element, parentFunction);
50967
+ }
50968
+ });
50969
+ }
50970
+ else if (p.type === 'AssignmentPattern') {
50971
+ handlePattern(p.left, parentFunction);
50972
+ }
50973
+ else {
50974
+ setScope(parentFunction, p.name);
50975
+ }
50976
+ }
50946
50977
  walk$1(root, {
50947
50978
  enter(node, parent) {
50948
50979
  if (node.type === 'ImportDeclaration') {
@@ -50973,25 +51004,31 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
50973
51004
  }
50974
51005
  // walk function expressions and add its arguments to known identifiers
50975
51006
  // so that we don't prefix them
50976
- node.params.forEach((p) => walk$1(p.type === 'AssignmentPattern' ? p.left : p, {
50977
- enter(child, parent) {
50978
- if (child.type !== 'Identifier')
50979
- return;
50980
- // do not record as scope variable if is a destructuring keyword
50981
- if (isStaticPropertyKey(child, parent))
50982
- return;
50983
- // do not record if this is a default value
50984
- // assignment of a destructuring variable
50985
- if (((parent === null || parent === void 0 ? void 0 : parent.type) === 'AssignmentPattern' &&
50986
- (parent === null || parent === void 0 ? void 0 : parent.right) === child) ||
50987
- ((parent === null || parent === void 0 ? void 0 : parent.type) === 'TemplateLiteral' &&
50988
- (parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child))) ||
50989
- ((parent === null || parent === void 0 ? void 0 : parent.type) === 'CallExpression' && (parent === null || parent === void 0 ? void 0 : parent.callee) === child)) {
50990
- return;
50991
- }
50992
- setScope(node, child.name);
51007
+ node.params.forEach((p) => {
51008
+ if (p.type === 'ObjectPattern' || p.type === 'ArrayPattern') {
51009
+ handlePattern(p, node);
51010
+ return;
50993
51011
  }
50994
- }));
51012
+ walk$1(p.type === 'AssignmentPattern' ? p.left : p, {
51013
+ enter(child, parent) {
51014
+ if (child.type !== 'Identifier')
51015
+ return;
51016
+ // do not record as scope variable if is a destructuring keyword
51017
+ if (isStaticPropertyKey(child, parent))
51018
+ return;
51019
+ // do not record if this is a default value
51020
+ // assignment of a destructuring variable
51021
+ if (((parent === null || parent === void 0 ? void 0 : parent.type) === 'AssignmentPattern' &&
51022
+ (parent === null || parent === void 0 ? void 0 : parent.right) === child) ||
51023
+ ((parent === null || parent === void 0 ? void 0 : parent.type) === 'TemplateLiteral' &&
51024
+ (parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child))) ||
51025
+ ((parent === null || parent === void 0 ? void 0 : parent.type) === 'CallExpression' && (parent === null || parent === void 0 ? void 0 : parent.callee) === child)) {
51026
+ return;
51027
+ }
51028
+ setScope(node, child.name);
51029
+ }
51030
+ });
51031
+ });
50995
51032
  }
50996
51033
  else if (node.type === 'Property' && parent.type === 'ObjectPattern') {
50997
51034
  node.inPattern = true;
@@ -50999,36 +51036,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
50999
51036
  else if (node.type === 'VariableDeclarator') {
51000
51037
  const parentFunction = findParentFunction(parentStack);
51001
51038
  if (parentFunction) {
51002
- const handlePattern = (p) => {
51003
- if (p.type === 'Identifier') {
51004
- setScope(parentFunction, p.name);
51005
- }
51006
- else if (p.type === 'RestElement') {
51007
- handlePattern(p.argument);
51008
- }
51009
- else if (p.type === 'ObjectPattern') {
51010
- p.properties.forEach((property) => {
51011
- if (property.type === 'RestElement') {
51012
- setScope(parentFunction, property.argument.name);
51013
- }
51014
- else
51015
- handlePattern(property.value);
51016
- });
51017
- }
51018
- else if (p.type === 'ArrayPattern') {
51019
- p.elements.forEach((element) => {
51020
- if (element)
51021
- handlePattern(element);
51022
- });
51023
- }
51024
- else if (p.type === 'AssignmentPattern') {
51025
- handlePattern(p.left);
51026
- }
51027
- else {
51028
- setScope(parentFunction, p.name);
51029
- }
51030
- };
51031
- handlePattern(node.id);
51039
+ handlePattern(node.id, parentFunction);
51032
51040
  }
51033
51041
  }
51034
51042
  },
@@ -74921,14 +74929,6 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
74921
74929
  continue;
74922
74930
  }
74923
74931
  const existing = merged[key];
74924
- if (Array.isArray(existing) && Array.isArray(value)) {
74925
- merged[key] = [...existing, ...value];
74926
- continue;
74927
- }
74928
- if (isObject$3(existing) && isObject$3(value)) {
74929
- merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key);
74930
- continue;
74931
- }
74932
74932
  // fields that require special handling
74933
74933
  if (existing != null) {
74934
74934
  if (key === 'alias' && (rootPath === 'resolve' || rootPath === '')) {
@@ -74943,6 +74943,14 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
74943
74943
  continue;
74944
74944
  }
74945
74945
  }
74946
+ if (Array.isArray(existing) || Array.isArray(value)) {
74947
+ merged[key] = [...arraify(existing), ...arraify(value)];
74948
+ continue;
74949
+ }
74950
+ if (isObject$3(existing) && isObject$3(value)) {
74951
+ merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key);
74952
+ continue;
74953
+ }
74946
74954
  merged[key] = value;
74947
74955
  }
74948
74956
  return merged;
@@ -75234,4 +75242,4 @@ exports.send = send$1;
75234
75242
  exports.sortUserPlugins = sortUserPlugins;
75235
75243
  exports.source = source;
75236
75244
  exports.transformWithEsbuild = transformWithEsbuild;
75237
- //# sourceMappingURL=dep-76613303.js.map
75245
+ //# sourceMappingURL=dep-48c3e8a4.js.map