diff --git a/packages/vite/src/node/utils.ts b/packages/vite/src/node/utils.ts index 582a3c2c6e43ef..c3cf7f853a29e9 100644 --- a/packages/vite/src/node/utils.ts +++ b/packages/vite/src/node/utils.ts @@ -1093,7 +1093,7 @@ function deepClone(value: T): DeepWritable { return value as DeepWritable } if (value instanceof RegExp) { - return structuredClone(value) as DeepWritable + return new RegExp(value) as DeepWritable } if (typeof value === 'object' && value != null) { throw new Error('Cannot deep clone non-plain object')