mirror of
https://github.com/alex8088/electron-vite.git
synced 2026-11-02 22:56:58 +08:00
fix(bytecode): set the regular expression's lastIndex to 0 to perform a global match for chunkAlias option
This commit is contained in:
parent
c047b58d5d
commit
c104b2d15b
@ -94,6 +94,7 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null {
|
|||||||
|
|
||||||
const isBytecodeChunk = (chunkName: string): boolean => {
|
const isBytecodeChunk = (chunkName: string): boolean => {
|
||||||
if (_chunkAlias instanceof RegExp) {
|
if (_chunkAlias instanceof RegExp) {
|
||||||
|
_chunkAlias.lastIndex = 0
|
||||||
return _chunkAlias.test(chunkName)
|
return _chunkAlias.test(chunkName)
|
||||||
}
|
}
|
||||||
return _chunkAlias.length === 0 || _chunkAlias.some(alias => alias === chunkName)
|
return _chunkAlias.length === 0 || _chunkAlias.some(alias => alias === chunkName)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user