Skip to content

Commit ce1b638

Browse files
committed
fixup! fix(@angular/build): use oxc-parser fallback when stripping source-map comments
1 parent 575c988 commit ce1b638

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/angular/build/src/utils/source-map.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ function removeSourceMappingURLFromString(code: string, skipTrailingCheck = fals
120120
}
121121
}
122122

123-
parseSync ??= (createRequire(__filename)('oxc-parser') as typeof import('oxc-parser')).parseSync;
123+
if (!parseSync) {
124+
const localRequire = createRequire(__filename);
125+
localRequire('../tools/oxc/oxc-wasi-shim');
126+
parseSync = (localRequire('oxc-parser') as typeof import('oxc-parser')).parseSync;
127+
}
124128

125129
const { comments } = parseSync('source.js', code, {
126130
lang: 'js',

0 commit comments

Comments
 (0)