From c104b2d15bb6dfaba0ade92a76ba1cac064187d5 Mon Sep 17 00:00:00 2001 From: alex8088 <244096523@qq.com> Date: Tue, 29 Sep 2026 23:45:48 +0800 Subject: [PATCH] fix(bytecode): set the regular expression's `lastIndex` to 0 to perform a global match for chunkAlias option --- src/plugins/bytecode.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/bytecode.ts b/src/plugins/bytecode.ts index 52768f1..b8f388d 100644 --- a/src/plugins/bytecode.ts +++ b/src/plugins/bytecode.ts @@ -94,6 +94,7 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null { const isBytecodeChunk = (chunkName: string): boolean => { if (_chunkAlias instanceof RegExp) { + _chunkAlias.lastIndex = 0 return _chunkAlias.test(chunkName) } return _chunkAlias.length === 0 || _chunkAlias.some(alias => alias === chunkName)