Skip to content

feat(bytecode): support RegExp for chunkAlias option - #885

Open
leey0818 wants to merge 1 commit into
alex8088:masterfrom
leey0818:feat/bytecode-regex-chunk-alias
Open

feat(bytecode): support RegExp for chunkAlias option#885
leey0818 wants to merge 1 commit into
alex8088:masterfrom
leey0818:feat/bytecode-regex-chunk-alias

Conversation

@leey0818

@leey0818 leey0818 commented Feb 12, 2026

Copy link
Copy Markdown

Description

Add RegExp support for BytecodeOptions.chunkAlias to allow pattern-based chunk matching.

Currently, chunkAlias only accepts string | string[], requiring exact chunk name matches. This change adds RegExp as an accepted type, enabling flexible pattern matching via RegExp.prototype.test().

Changes:

  • Add RegExp to the chunkAlias type definition in BytecodeOptions
  • Update _chunkAlias initialization to handle RegExp type
  • Update isBytecodeChunk to use RegExp.test() when a regex is provided

Additional context

This is useful when chunk names follow a naming convention and users want to match multiple chunks without listing each name explicitly.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leey0818
leey0818 force-pushed the feat/bytecode-regex-chunk-alias branch from baf6f02 to deed6f5 Compare February 12, 2026 04:44
@leey0818

Copy link
Copy Markdown
Author

Force pushed to fix missing code: added RegExp instance check for _chunkAlias initialization.

kitschpatrol pushed a commit to kitschpatrol/electron-vite that referenced this pull request Jul 16, 2026
Fork release as @desirecore/electron-vite (v6.0.0-beta.2). Fixes a batch
of Vite 8 / Rolldown regressions and Electron 42 support, and merges
several long-pending upstream fixes.

- fix(esmShim): AST-based CJS shim injection at offset 0, no longer
  corrupts large Vite 8/Rolldown ESM bundles (alex8088#906)
- fix(swc): also set `oxc: false` to disable Vite 8 default transform (alex8088#916)
- fix(config): do not throw on non-plain objects when isolating config (alex8088#902)
- fix(renderer): re-root when HTML entry is outside root, avoid illegal
  `../` emit paths under Rolldown (alex8088#915)
- fix(bytecode): compile via vm.compileFunction in the consuming process
  type, fixing cachedDataRejected on Electron 42 / V8 14.8 (alex8088#911, alex8088#912)
- fix(bytecode): remove non-deterministic compile race (alex8088#910)
- fix(bytecode): correct renderer preset plugin name; locate the compiler
  script relative to this module so it survives package renames
- fix(modulePath): inject modulePathPlugin into the sub-build for nested
  `?modulePath` and re-exports (alex8088#860, alex8088#862)
- fix(dev): forward signals to the Electron child and escalate to SIGKILL
  on restart, fixing zombie processes (alex8088#899, alex8088#734, alex8088#353)
- feat: support Electron 42 targets and lazy electron install (alex8088#904)
- feat(bytecode): allow RegExp for chunkAlias; protect string concat (alex8088#885)
- feat(cli): add --noElectronStart (alex8088#578) and --electronPackage (alex8088#867)
- feat: export workerPlugin (alex8088#480)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant