Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): prevent differential loading doub…
Browse files Browse the repository at this point in the history
…le sourcemap search

This can drastically reduce memory usage; especially in cases where bundled code modules contain individual sourcemap comments and vendor sourcemaps are disabled.  Enabling the vendor sourcemap option has the side effect of removing all individual module sourcemap comments and as a result removes the potential for those comments to be found and processed.
  • Loading branch information
clydin authored and vikerman committed Jan 2, 2020
1 parent 5facdf1 commit 1ab6091
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,16 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
const manualSourceMaps = codeSize >= 1024 * 1024 || mapSize >= 1024 * 1024;

const sourceCode = options.code;
const sourceMap = options.map ? JSON.parse(options.map) : undefined;
const sourceMap = options.map ? JSON.parse(options.map) : false;

let downlevelCode;
let downlevelMap;
if (downlevel) {
// Downlevel the bundle
const transformResult = await transformAsync(sourceCode, {
filename: options.filename,
inputSourceMap: manualSourceMaps ? undefined : sourceMap,
// using false ensures that babel will NOT search and process sourcemap comments (large memory usage)
inputSourceMap: manualSourceMaps ? false : sourceMap,
babelrc: false,
presets: [
[
Expand Down

0 comments on commit 1ab6091

Please sign in to comment.