diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-19 07:06:23 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-19 07:06:23 -0400 |
commit | 2c65292119d13b880ad57783dda434147b6f6980 (patch) | |
tree | b090637789548dd61f98f4c1774f03f8802caccb /runtime.ts | |
parent | ca8eb1d421cbe4dbe6f80312b9cc6e1f9ed4a47c (diff) |
Source map support. Partially working.
Diffstat (limited to 'runtime.ts')
-rw-r--r-- | runtime.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime.ts b/runtime.ts index 7d6633ca9..1b1e309b5 100644 --- a/runtime.ts +++ b/runtime.ts @@ -14,6 +14,10 @@ import "./url"; const EOL = "\n"; +// tslint:disable-next-line:no-any +type AmdFactory = (...args: any[]) => undefined | object; +type AmdDefine = (deps: string[], factory: AmdFactory) => void; + // This class represents a module. We call it FileModule to make it explicit // that each module represents a single file. // Access to FileModule instances should only be done thru the static method @@ -66,10 +70,6 @@ export class FileModule { } } -// tslint:disable-next-line:no-any -type AmdFactory = (...args: any[]) => undefined | object; -type AmdDefine = (deps: string[], factory: AmdFactory) => void; - export function makeDefine(fileName: string): AmdDefine { const localDefine = (deps: string[], factory: AmdFactory): void => { const localRequire = (x: string) => { @@ -122,6 +122,7 @@ function resolveModuleName( function execute(fileName: string, outputCode: string): void { util.assert(outputCode && outputCode.length > 0); util._global["define"] = makeDefine(fileName); + outputCode += "\n//# sourceURL=" + fileName; util.globalEval(outputCode); util._global["define"] = null; } @@ -131,12 +132,12 @@ class Compiler { options: ts.CompilerOptions = { allowJs: true, module: ts.ModuleKind.AMD, - outDir: "$deno$" + outDir: "$deno$", + inlineSourceMap: true, + inlineSources: true }; /* allowJs: true, - inlineSourceMap: true, - inlineSources: true, module: ts.ModuleKind.AMD, noEmit: false, outDir: '$deno$', |