diff --git a/packages/vite/src/node/plugins/asset.ts b/packages/vite/src/node/plugins/asset.ts index d7fa0e9264e5be..d3fc794754ab4b 100644 --- a/packages/vite/src/node/plugins/asset.ts +++ b/packages/vite/src/node/plugins/asset.ts @@ -61,7 +61,7 @@ export function renderAssetUrlInJS( // In both cases, the wrapping should already be fine while ((match = assetUrlRE.exec(code))) { - s ||= s = new MagicString(code) + s ||= new MagicString(code) const [full, hash, postfix = ''] = match // some internal plugins may still need to emit chunks (e.g. worker) so // fallback to this.getFileName for that. TODO: remove, not needed