Skip to content

Commit 0c64e57

Browse files
committed
fix(@angular-devkit/build-angular): use manual sourcemap processing for large sourcemaps
Mitigates angular#15493
1 parent 4aaec9c commit 0c64e57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/angular_devkit/build_angular/src/utils/process-bundle.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ async function processWorker(options: ProcessBundleOptions): Promise<void> {
5656
// if code size is larger than 500kB, manually handle sourcemaps with newer source-map package.
5757
// babel currently uses an older version that still supports sync calls
5858
const codeSize = Buffer.byteLength(options.code, 'utf8');
59-
const manualSourceMaps = codeSize >= 500 * 1024;
59+
const mapSize = options.map ? Buffer.byteLength(options.map, 'utf8') : 0;
60+
const manualSourceMaps = codeSize >= 500 * 1024 || mapSize >= 500 * 1024;
6061

6162
// downlevel the bundle
6263
let { code, map } = await transformAsync(options.code, {

0 commit comments

Comments
 (0)