mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Decode main.js.map during snapshotting.
Pro: time ./out/debug/deno tests/error_001.ts 3.0s -> 0.4s Con: time ./tool/build.py snapshot 33s -> 1m52s out/debug/gen/snapshot_deno.bin 39M -> 121M
This commit is contained in:
parent
27ecfc1617
commit
b3400d822f
4 changed files with 21 additions and 13 deletions
|
@ -388,6 +388,7 @@ export class DenoCompiler
|
|||
let lastModule: ModuleMetaData | undefined;
|
||||
sourceMaps.install({
|
||||
installPrepareStackTrace: true,
|
||||
|
||||
getGeneratedContents: (fileName: string): string | RawSourceMap => {
|
||||
this._log("compiler.getGeneratedContents", fileName);
|
||||
if (fileName === "gen/bundle/main.js") {
|
||||
|
@ -419,6 +420,11 @@ export class DenoCompiler
|
|||
}
|
||||
}
|
||||
});
|
||||
// Pre-compute source maps for main.js.map. This will happen at compile-time
|
||||
// as long as Compiler is instanciated before the snapshot is created..
|
||||
const consumer = sourceMaps.loadConsumer("gen/bundle/main.js");
|
||||
assert(consumer != null);
|
||||
consumer!.computeColumnSpans();
|
||||
}
|
||||
|
||||
private constructor() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue