Skip to content

Commit 30eed2c

Browse files
sirtimidclaude
andcommitted
fix(kernel-utils): align removeDynamicImportsPlugin fast-path with its regex
The early-return guard `code.includes('import(')` required the token `import` and `(` to be adjacent, but the replacement regex allows optional whitespace (`\bimport\s*\(`). A source file containing `import ('specifier')` (space before the paren) would have been skipped by the guard and left untransformed, causing Rolldown to reject the IIFE build despite the plugin's purpose being to prevent that. Replace the string fast-path with the equivalent regex test so both paths agree on which files contain dynamic imports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent aa4deaf commit 30eed2c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/kernel-utils/src/vite-plugins/bundle-vat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function removeDynamicImportsPlugin(): RolldownPlugin {
2929
return {
3030
name: 'ocap-kernel:remove-dynamic-imports',
3131
transform(code) {
32-
if (!code.includes('import(')) {
32+
if (!/\bimport\s*\(/u.test(code)) {
3333
return null;
3434
}
3535

0 commit comments

Comments
 (0)