vite 2.7.0 → 2.7.4

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.

Files changed (90) hide show
  1. package/CHANGELOG.md +78 -29
  2. package/LICENSE.md +41 -11
  3. package/dist/client/client.mjs.map +1 -1
  4. package/dist/node/build.d.ts +200 -0
  5. package/dist/node/chunks/{dep-58399509.js → dep-2d8e2cb1.js} +1 -1
  6. package/dist/node/chunks/dep-2d8e2cb1.js.map +1 -0
  7. package/dist/node/chunks/{dep-4dd87a09.js → dep-a89a79de.js} +2 -2
  8. package/dist/node/chunks/{dep-4dd87a09.js.map → dep-a89a79de.js.map} +1 -1
  9. package/dist/node/chunks/{dep-7e125991.js → dep-cb6d7f22.js} +660 -209
  10. package/dist/node/chunks/dep-cb6d7f22.js.map +1 -0
  11. package/dist/node/chunks/{dep-1ce37657.js → dep-ef3cdce0.js} +79 -61
  12. package/dist/node/chunks/dep-ef3cdce0.js.map +1 -0
  13. package/dist/node/chunks/{dep-4619561c.js → dep-fd7e14cf.js} +2 -2
  14. package/dist/node/chunks/dep-fd7e14cf.js.map +1 -0
  15. package/dist/node/cli.d.ts +1 -0
  16. package/dist/node/cli.js +4 -4
  17. package/dist/node/cli.js.map +1 -1
  18. package/dist/node/config.d.ts +202 -0
  19. package/dist/node/constants.d.ts +33 -0
  20. package/dist/node/http.d.ts +84 -0
  21. package/dist/node/importGlob.d.ts +9 -0
  22. package/dist/node/index.d.ts +317 -322
  23. package/dist/node/index.js +1 -1
  24. package/dist/node/logger.d.ts +35 -0
  25. package/dist/node/optimizer/esbuildDepPlugin.d.ts +4 -0
  26. package/dist/node/optimizer/index.d.ts +66 -0
  27. package/dist/node/optimizer/registerMissing.d.ts +2 -0
  28. package/dist/node/optimizer/scan.d.ts +9 -0
  29. package/dist/node/packages.d.ts +25 -0
  30. package/dist/node/plugin.d.ts +115 -0
  31. package/dist/node/plugins/asset.d.ts +40 -0
  32. package/dist/node/plugins/assetImportMetaUrl.d.ts +13 -0
  33. package/dist/node/plugins/clientInjections.d.ts +7 -0
  34. package/dist/node/plugins/css.d.ts +70 -0
  35. package/dist/node/plugins/dataUri.d.ts +5 -0
  36. package/dist/node/plugins/define.d.ts +3 -0
  37. package/dist/node/plugins/esbuild.d.ts +15 -0
  38. package/dist/node/plugins/html.d.ts +102 -0
  39. package/dist/node/plugins/importAnalysis.d.ts +46 -0
  40. package/dist/node/plugins/importAnalysisBuild.d.ts +15 -0
  41. package/dist/node/plugins/index.d.ts +3 -0
  42. package/dist/node/plugins/json.d.ts +22 -0
  43. package/dist/node/plugins/loadFallback.d.ts +5 -0
  44. package/dist/node/plugins/manifest.d.ts +14 -0
  45. package/dist/node/plugins/modulePreloadPolyfill.d.ts +4 -0
  46. package/dist/node/plugins/preAlias.d.ts +5 -0
  47. package/dist/node/plugins/reporter.d.ts +3 -0
  48. package/dist/node/plugins/resolve.d.ts +38 -0
  49. package/dist/node/plugins/ssrRequireHook.d.ts +12 -0
  50. package/dist/node/plugins/terser.d.ts +3 -0
  51. package/dist/node/plugins/wasm.d.ts +3 -0
  52. package/dist/node/plugins/worker.d.ts +3 -0
  53. package/dist/node/preview.d.ts +31 -0
  54. package/dist/node/server/hmr.d.ts +37 -0
  55. package/dist/node/server/index.d.ts +215 -0
  56. package/dist/node/server/middlewares/base.d.ts +3 -0
  57. package/dist/node/server/middlewares/error.d.ts +8 -0
  58. package/dist/node/server/middlewares/indexHtml.d.ts +4 -0
  59. package/dist/node/server/middlewares/proxy.d.ts +20 -0
  60. package/dist/node/server/middlewares/spaFallback.d.ts +2 -0
  61. package/dist/node/server/middlewares/static.d.ts +6 -0
  62. package/dist/node/server/middlewares/time.d.ts +2 -0
  63. package/dist/node/server/middlewares/transform.d.ts +3 -0
  64. package/dist/node/server/moduleGraph.d.ts +53 -0
  65. package/dist/node/server/openBrowser.d.ts +15 -0
  66. package/dist/node/server/pluginContainer.d.ts +37 -0
  67. package/dist/node/server/searchRoot.d.ts +8 -0
  68. package/dist/node/server/send.d.ts +4 -0
  69. package/dist/node/server/sourcemap.d.ts +8 -0
  70. package/dist/node/server/transformRequest.d.ts +14 -0
  71. package/dist/node/server/ws.d.ts +14 -0
  72. package/dist/node/ssr/ssrExternal.d.ts +7 -0
  73. package/dist/node/ssr/ssrManifestPlugin.d.ts +3 -0
  74. package/dist/node/ssr/ssrModuleLoader.d.ts +7 -0
  75. package/dist/node/ssr/ssrStacktrace.d.ts +3 -0
  76. package/dist/node/ssr/ssrTransform.d.ts +8 -0
  77. package/dist/node/utils.d.ts +114 -0
  78. package/package.json +15 -15
  79. package/src/client/client.ts +2 -2
  80. package/src/client/overlay.ts +1 -1
  81. package/types/alias.d.ts +1 -1
  82. package/types/chokidar.d.ts +2 -2
  83. package/types/http-proxy.d.ts +4 -4
  84. package/types/importMeta.d.ts +13 -14
  85. package/types/shims.d.ts +5 -5
  86. package/types/ws.d.ts +284 -288
  87. package/dist/node/chunks/dep-1ce37657.js.map +0 -1
  88. package/dist/node/chunks/dep-4619561c.js.map +0 -1
  89. package/dist/node/chunks/dep-58399509.js.map +0 -1
  90. package/dist/node/chunks/dep-7e125991.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var build = require('./dep-7e125991.js');
3
+ var build = require('./dep-cb6d7f22.js');
4
4
 
5
5
  function _mergeNamespaces(n, m) {
6
6
  for (var i = 0; i < m.length; i++) {
@@ -132,7 +132,7 @@ const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
132
132
  `checked,muted,multiple,selected`);
133
133
  /**
134
134
  * Boolean attributes should be included if the value is truthy or ''.
135
- * e.g. <select multiple> compiles to { multiple: '' }
135
+ * e.g. `<select multiple>` compiles to `{ multiple: '' }`
136
136
  */
137
137
  function includeBooleanAttr(value) {
138
138
  return !!value || value === '';
@@ -521,7 +521,7 @@ const isIntegerKey = (key) => isString(key) &&
521
521
  '' + parseInt(key, 10) === key;
522
522
  const isReservedProp = /*#__PURE__*/ makeMap(
523
523
  // the leading comma is intentional so empty string "" is also included
524
- ',key,ref,' +
524
+ ',key,ref,ref_for,ref_key,' +
525
525
  'onVnodeBeforeMount,onVnodeMounted,' +
526
526
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
527
527
  'onVnodeBeforeUnmount,onVnodeUnmounted');
@@ -1159,12 +1159,12 @@ function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
1159
1159
  }
1160
1160
  else if (p.name === 'bind' &&
1161
1161
  (p.exp || allowEmpty) &&
1162
- isBindKey(p.arg, name)) {
1162
+ isStaticArgOf(p.arg, name)) {
1163
1163
  return p;
1164
1164
  }
1165
1165
  }
1166
1166
  }
1167
- function isBindKey(arg, name) {
1167
+ function isStaticArgOf(arg, name) {
1168
1168
  return !!(arg && isStaticExp(arg) && arg.content === name);
1169
1169
  }
1170
1170
  function hasDynamicKeyVBind(node) {
@@ -1207,7 +1207,6 @@ function getUnnormalizedProps(props, callPath = []) {
1207
1207
  }
1208
1208
  function injectProp(node, prop, context) {
1209
1209
  let propsWithInjection;
1210
- const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
1211
1210
  /**
1212
1211
  * 1. mergeProps(...)
1213
1212
  * 2. toHandlers(...)
@@ -1216,7 +1215,7 @@ function injectProp(node, prop, context) {
1216
1215
  *
1217
1216
  * we need to get the real props before normalization
1218
1217
  */
1219
- let props = originalProps;
1218
+ let props = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
1220
1219
  let callPath = [];
1221
1220
  let parentCall;
1222
1221
  if (props &&
@@ -1399,11 +1398,6 @@ const deprecationData = {
1399
1398
  `data source.`,
1400
1399
  link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`
1401
1400
  },
1402
- ["COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */]: {
1403
- message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
1404
- `Consider using function refs or refactor to avoid ref usage altogether.`,
1405
- link: `https://v3.vuejs.org/guide/migration/array-refs.html`
1406
- },
1407
1401
  ["COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */]: {
1408
1402
  message: `<template> with no special directives will render as a native template ` +
1409
1403
  `element instead of its inner content in Vue 3.`
@@ -1923,7 +1917,7 @@ function isComponent(tag, props, context) {
1923
1917
  else if (
1924
1918
  // :is on plain element - only treat as component in compat mode
1925
1919
  p.name === 'bind' &&
1926
- isBindKey(p.arg, 'is') &&
1920
+ isStaticArgOf(p.arg, 'is') &&
1927
1921
  true &&
1928
1922
  checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
1929
1923
  return true;
@@ -2283,15 +2277,6 @@ function isSingleElementRoot(root, child) {
2283
2277
  !isSlotOutlet(child));
2284
2278
  }
2285
2279
  function walk(node, context, doNotHoistNode = false) {
2286
- // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
2287
- // static bindings with expressions. These expressions are guaranteed to be
2288
- // constant so they are still eligible for hoisting, but they are only
2289
- // available at runtime and therefore cannot be evaluated ahead of time.
2290
- // This is only a concern for pre-stringification (via transformHoist by
2291
- // @vue/compiler-dom), but doing it here allows us to perform only one full
2292
- // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
2293
- // stringification threshold is met.
2294
- let canStringify = true;
2295
2280
  const { children } = node;
2296
2281
  const originalCount = children.length;
2297
2282
  let hoistedCount = 0;
@@ -2304,9 +2289,6 @@ function walk(node, context, doNotHoistNode = false) {
2304
2289
  ? 0 /* NOT_CONSTANT */
2305
2290
  : getConstantType(child, context);
2306
2291
  if (constantType > 0 /* NOT_CONSTANT */) {
2307
- if (constantType < 3 /* CAN_STRINGIFY */) {
2308
- canStringify = false;
2309
- }
2310
2292
  if (constantType >= 2 /* CAN_HOIST */) {
2311
2293
  child.codegenNode.patchFlag =
2312
2294
  -1 /* HOISTED */ + ((process.env.NODE_ENV !== 'production') ? ` /* HOISTED */` : ``);
@@ -2337,17 +2319,10 @@ function walk(node, context, doNotHoistNode = false) {
2337
2319
  }
2338
2320
  }
2339
2321
  }
2340
- else if (child.type === 12 /* TEXT_CALL */) {
2341
- const contentType = getConstantType(child.content, context);
2342
- if (contentType > 0) {
2343
- if (contentType < 3 /* CAN_STRINGIFY */) {
2344
- canStringify = false;
2345
- }
2346
- if (contentType >= 2 /* CAN_HOIST */) {
2347
- child.codegenNode = context.hoist(child.codegenNode);
2348
- hoistedCount++;
2349
- }
2350
- }
2322
+ else if (child.type === 12 /* TEXT_CALL */ &&
2323
+ getConstantType(child.content, context) >= 2 /* CAN_HOIST */) {
2324
+ child.codegenNode = context.hoist(child.codegenNode);
2325
+ hoistedCount++;
2351
2326
  }
2352
2327
  // walk further
2353
2328
  if (child.type === 1 /* ELEMENT */) {
@@ -2371,7 +2346,7 @@ function walk(node, context, doNotHoistNode = false) {
2371
2346
  }
2372
2347
  }
2373
2348
  }
2374
- if (canStringify && hoistedCount && context.transformHoist) {
2349
+ if (hoistedCount && context.transformHoist) {
2375
2350
  context.transformHoist(children, context, node);
2376
2351
  }
2377
2352
  // all children were hoisted - the entire children array is hoistable.
@@ -2400,6 +2375,11 @@ function getConstantType(node, context) {
2400
2375
  if (codegenNode.type !== 13 /* VNODE_CALL */) {
2401
2376
  return 0 /* NOT_CONSTANT */;
2402
2377
  }
2378
+ if (codegenNode.isBlock &&
2379
+ node.tag !== 'svg' &&
2380
+ node.tag !== 'foreignObject') {
2381
+ return 0 /* NOT_CONSTANT */;
2382
+ }
2403
2383
  const flag = getPatchFlag(codegenNode);
2404
2384
  if (!flag) {
2405
2385
  let returnType = 3 /* CAN_STRINGIFY */;
@@ -2537,7 +2517,7 @@ function getGeneratedPropsConstantType(node, context) {
2537
2517
  else if (value.type === 14 /* JS_CALL_EXPRESSION */) {
2538
2518
  // some helper calls can be hoisted,
2539
2519
  // such as the `normalizeProps` generated by the compiler for pre-normalize class,
2540
- // in this case we need to respect the ConstantType of the helper's argments
2520
+ // in this case we need to respect the ConstantType of the helper's arguments
2541
2521
  valueType = getConstantTypeOfHelperCall(value, context);
2542
2522
  }
2543
2523
  else {
@@ -4328,10 +4308,7 @@ const transformElement = (node, context) => {
4328
4308
  // updates inside get proper isSVG flag at runtime. (#639, #643)
4329
4309
  // This is technically web-specific, but splitting the logic out of core
4330
4310
  // leads to too much unnecessary complexity.
4331
- (tag === 'svg' ||
4332
- tag === 'foreignObject' ||
4333
- // #938: elements with dynamic keys should be forced into blocks
4334
- findProp(node, 'key', true)));
4311
+ (tag === 'svg' || tag === 'foreignObject'));
4335
4312
  // props
4336
4313
  if (props.length > 0) {
4337
4314
  const propsBuildResult = buildProps(node, context);
@@ -4343,6 +4320,9 @@ const transformElement = (node, context) => {
4343
4320
  directives && directives.length
4344
4321
  ? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))
4345
4322
  : undefined;
4323
+ if (propsBuildResult.shouldUseBlock) {
4324
+ shouldUseBlock = true;
4325
+ }
4346
4326
  }
4347
4327
  // children
4348
4328
  if (node.children.length > 0) {
@@ -4474,11 +4454,13 @@ function resolveComponentType(node, context, ssr = false) {
4474
4454
  return toValidAssetId(tag, `component`);
4475
4455
  }
4476
4456
  function buildProps(node, context, props = node.props, ssr = false) {
4477
- const { tag, loc: elementLoc } = node;
4457
+ const { tag, loc: elementLoc, children } = node;
4478
4458
  const isComponent = node.tagType === 1 /* COMPONENT */;
4479
4459
  let properties = [];
4480
4460
  const mergeArgs = [];
4481
4461
  const runtimeDirectives = [];
4462
+ const hasChildren = children.length > 0;
4463
+ let shouldUseBlock = false;
4482
4464
  // patchFlag analysis
4483
4465
  let patchFlag = 0;
4484
4466
  let hasRef = false;
@@ -4541,9 +4523,12 @@ function buildProps(node, context, props = node.props, ssr = false) {
4541
4523
  const prop = props[i];
4542
4524
  if (prop.type === 6 /* ATTRIBUTE */) {
4543
4525
  const { loc, name, value } = prop;
4544
- let valueNode = createSimpleExpression(value ? value.content : '', true, value ? value.loc : loc);
4526
+ let isStatic = true;
4545
4527
  if (name === 'ref') {
4546
4528
  hasRef = true;
4529
+ if (context.scopes.vFor > 0) {
4530
+ properties.push(createObjectProperty(createSimpleExpression('ref_for', true), createSimpleExpression('true')));
4531
+ }
4547
4532
  }
4548
4533
  // skip is on <component>, or is="vue:xxx"
4549
4534
  if (name === 'is' &&
@@ -4552,7 +4537,7 @@ function buildProps(node, context, props = node.props, ssr = false) {
4552
4537
  (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context)))) {
4553
4538
  continue;
4554
4539
  }
4555
- properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), valueNode));
4540
+ properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
4556
4541
  }
4557
4542
  else {
4558
4543
  // directives
@@ -4573,7 +4558,7 @@ function buildProps(node, context, props = node.props, ssr = false) {
4573
4558
  // skip v-is and :is on <component>
4574
4559
  if (name === 'is' ||
4575
4560
  (isVBind &&
4576
- isBindKey(arg, 'is') &&
4561
+ isStaticArgOf(arg, 'is') &&
4577
4562
  (isComponentTag(tag) ||
4578
4563
  (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))))) {
4579
4564
  continue;
@@ -4582,6 +4567,17 @@ function buildProps(node, context, props = node.props, ssr = false) {
4582
4567
  if (isVOn && ssr) {
4583
4568
  continue;
4584
4569
  }
4570
+ if (
4571
+ // #938: elements with dynamic keys should be forced into blocks
4572
+ (isVBind && isStaticArgOf(arg, 'key')) ||
4573
+ // inline before-update hooks need to force block so that it is invoked
4574
+ // before children
4575
+ (isVOn && hasChildren && isStaticArgOf(arg, 'vue:before-update'))) {
4576
+ shouldUseBlock = true;
4577
+ }
4578
+ if (isVBind && isStaticArgOf(arg, 'ref') && context.scopes.vFor > 0) {
4579
+ properties.push(createObjectProperty(createSimpleExpression('ref_for', true), createSimpleExpression('true')));
4580
+ }
4585
4581
  // special case for v-bind and v-on with no argument
4586
4582
  if (!arg && (isVBind || isVOn)) {
4587
4583
  hasDynamicKeys = true;
@@ -4655,14 +4651,13 @@ function buildProps(node, context, props = node.props, ssr = false) {
4655
4651
  else {
4656
4652
  // no built-in transform, this is a user custom directive.
4657
4653
  runtimeDirectives.push(prop);
4654
+ // custom dirs may use beforeUpdate so they need to force blocks
4655
+ // to ensure before-update gets called before children update
4656
+ if (hasChildren) {
4657
+ shouldUseBlock = true;
4658
+ }
4658
4659
  }
4659
4660
  }
4660
- if (prop.type === 6 /* ATTRIBUTE */ &&
4661
- prop.name === 'ref' &&
4662
- context.scopes.vFor > 0 &&
4663
- checkCompatEnabled("COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */, context, prop.loc)) {
4664
- properties.push(createObjectProperty(createSimpleExpression('refInFor', true), createSimpleExpression('true', false)));
4665
- }
4666
4661
  }
4667
4662
  let propsExpression = undefined;
4668
4663
  // has v-bind="object" or v-on="object", wrap with mergeProps
@@ -4699,7 +4694,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
4699
4694
  patchFlag |= 32 /* HYDRATE_EVENTS */;
4700
4695
  }
4701
4696
  }
4702
- if ((patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&
4697
+ if (!shouldUseBlock &&
4698
+ (patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&
4703
4699
  (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
4704
4700
  patchFlag |= 512 /* NEED_PATCH */;
4705
4701
  }
@@ -4766,7 +4762,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
4766
4762
  props: propsExpression,
4767
4763
  directives: runtimeDirectives,
4768
4764
  patchFlag,
4769
- dynamicPropNames
4765
+ dynamicPropNames,
4766
+ shouldUseBlock
4770
4767
  };
4771
4768
  }
4772
4769
  // Dedupe props in an object literal.
@@ -4921,7 +4918,7 @@ function processSlotOutlet(node, context) {
4921
4918
  }
4922
4919
  }
4923
4920
  else {
4924
- if (p.name === 'bind' && isBindKey(p.arg, 'name')) {
4921
+ if (p.name === 'bind' && isStaticArgOf(p.arg, 'name')) {
4925
4922
  if (p.exp)
4926
4923
  slotName = p.exp;
4927
4924
  }
@@ -4955,7 +4952,11 @@ const transformOn = (dir, node, context, augmentor) => {
4955
4952
  let eventName;
4956
4953
  if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
4957
4954
  if (arg.isStatic) {
4958
- const rawName = arg.content;
4955
+ let rawName = arg.content;
4956
+ // TODO deprecate @vnodeXXX usage
4957
+ if (rawName.startsWith('vue:')) {
4958
+ rawName = `vnode-${rawName.slice(4)}`;
4959
+ }
4959
4960
  // for all event listeners, auto convert it to camelCase. See issue #2249
4960
4961
  eventName = createSimpleExpression(toHandlerKey(camelize$1(rawName)), true, arg.loc);
4961
4962
  }
@@ -5581,7 +5582,6 @@ var compilerCore_esmBundler = {
5581
5582
  hasScopeRef: hasScopeRef,
5582
5583
  helperNameMap: helperNameMap,
5583
5584
  injectProp: injectProp,
5584
- isBindKey: isBindKey,
5585
5585
  isBuiltInType: isBuiltInType,
5586
5586
  isCoreComponent: isCoreComponent,
5587
5587
  isFunctionType: isFunctionType,
@@ -5592,6 +5592,7 @@ var compilerCore_esmBundler = {
5592
5592
  isReferencedIdentifier: isReferencedIdentifier,
5593
5593
  isSimpleIdentifier: isSimpleIdentifier,
5594
5594
  isSlotOutlet: isSlotOutlet,
5595
+ isStaticArgOf: isStaticArgOf,
5595
5596
  isStaticExp: isStaticExp,
5596
5597
  isStaticProperty: isStaticProperty,
5597
5598
  isStaticPropertyKey: isStaticPropertyKey,
@@ -8396,6 +8397,11 @@ function hasMultipleChildren(node) {
8396
8397
  /**
8397
8398
  * This module is Node-only.
8398
8399
  */
8400
+ /**
8401
+ * Regex for replacing placeholders for embedded constant variables
8402
+ * (e.g. import URL string constants generated by compiler-sfc)
8403
+ */
8404
+ const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
8399
8405
  /**
8400
8406
  * Turn eligible hoisted static trees into stringified static nodes, e.g.
8401
8407
  *
@@ -8432,7 +8438,7 @@ const stringifyStatic = (children, context, parent) => {
8432
8438
  ec >= 5 /* ELEMENT_WITH_BINDING_COUNT */) {
8433
8439
  // combine all currently eligible nodes into a single static vnode call
8434
8440
  const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
8435
- JSON.stringify(currentChunk.map(node => stringifyNode(node, context)).join('')),
8441
+ JSON.stringify(currentChunk.map(node => stringifyNode(node, context)).join('')).replace(expReplaceRE, `" + $1 + "`),
8436
8442
  // the 2nd argument indicates the number of DOM nodes this static vnode
8437
8443
  // will insert / hydrate
8438
8444
  String(currentChunk.length)
@@ -8500,7 +8506,7 @@ const replaceHoist = (node, replacement, context) => {
8500
8506
  const isNonStringifiable = /*#__PURE__*/ shared.makeMap(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
8501
8507
  /**
8502
8508
  * for a hoisted node, analyze it and return:
8503
- * - false: bailed (contains runtime constant)
8509
+ * - false: bailed (contains non-stringifiable props or runtime constant)
8504
8510
  * - [nc, ec] where
8505
8511
  * - nc is the number of nodes inside
8506
8512
  * - ec is the number of element with bindings inside
@@ -8538,6 +8544,11 @@ function analyzeNode(node) {
8538
8544
  (p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns)))) {
8539
8545
  return bail();
8540
8546
  }
8547
+ if (p.exp &&
8548
+ (p.exp.type === 8 /* COMPOUND_EXPRESSION */ ||
8549
+ p.exp.constType < 3 /* CAN_STRINGIFY */)) {
8550
+ return bail();
8551
+ }
8541
8552
  }
8542
8553
  }
8543
8554
  for (let i = 0; i < node.children.length; i++) {
@@ -8593,8 +8604,15 @@ function stringifyElement(node, context) {
8593
8604
  }
8594
8605
  }
8595
8606
  else if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind') {
8607
+ const exp = p.exp;
8608
+ if (exp.content[0] === '_') {
8609
+ // internally generated string constant references
8610
+ // e.g. imported URL strings via compiler-sfc transformAssetUrl plugin
8611
+ res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
8612
+ continue;
8613
+ }
8596
8614
  // constant v-bind, e.g. :foo="1"
8597
- let evaluated = evaluateConstant(p.exp);
8615
+ let evaluated = evaluateConstant(exp);
8598
8616
  if (evaluated != null) {
8599
8617
  const arg = p.arg && p.arg.content;
8600
8618
  if (arg === 'class') {
@@ -8720,4 +8738,4 @@ var compilerDom_cjs$1 = /*#__PURE__*/_mergeNamespaces({
8720
8738
  }, [compilerDom_cjs$2]);
8721
8739
 
8722
8740
  exports.compilerDom_cjs = compilerDom_cjs$1;
8723
- //# sourceMappingURL=dep-1ce37657.js.map
8741
+ //# sourceMappingURL=dep-ef3cdce0.js.map