Skip to content

Commit 718cc64

Browse files
authored
Merge pull request #1984 from embroider-build/audit-vite-ignore
narrow the audit exception for vite internals
2 parents 966c541 + 98e04d9 commit 718cc64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/compat/src/audit/babel-visitor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export function auditJS(rawSource: string, filename: string, babelConfig: Transf
7373
codeFrameIndex: saveCodeFrame(arg),
7474
specifiers: [],
7575
});
76-
} else if (arg.type === 'BinaryExpression') {
77-
// ignore binary expressions. Vite uses these (somehow) in the `@vite/client` import
76+
} else if (arg.leadingComments?.find(c => /@vite-ignore/.test(c.value))) {
77+
// this is vite internals that we should ignore too
7878
} else {
7979
problems.push({
8080
message: `audit tool is unable to understand this usage of ${

0 commit comments

Comments
 (0)