diff --git a/lib/before-prepare.js b/lib/before-prepare.js index d580d18..e53483b 100644 --- a/lib/before-prepare.js +++ b/lib/before-prepare.js @@ -6,5 +6,5 @@ module.exports = function ($logger, $projectData, $usbLiveSyncService) { if (liveSync || bundle) { return; } - return compiler.runTypeScriptCompiler($logger, $projectData.projectDir); + return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { release: $projectData.$options.release }); } diff --git a/lib/compiler.js b/lib/compiler.js index 1c1509c..f405445 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -28,6 +28,15 @@ function runTypeScriptCompiler(logger, projectDir, options) { nodeArgs.push('--watch'); } + if (!options.release) { + // For debugging in Chrome DevTools + nodeArgs.push( + '--sourceMap', 'false', + '--inlineSourceMap', 'true', + '--inlineSources', 'true' + ); + } + var tsc = spawn(process.execPath, nodeArgs); var isResolved = false; tsc.stdout.on('data', function(data) { diff --git a/lib/watch.js b/lib/watch.js index 547f716..090d0db 100644 --- a/lib/watch.js +++ b/lib/watch.js @@ -1,5 +1,5 @@ var compiler = require('./compiler'); module.exports = function ($logger, $projectData, $errors) { - return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { watch: true }); + return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { watch: true, release: $projectData.$options.release }); } diff --git a/postinstall.js b/postinstall.js index 2724dd0..10eab09 100644 --- a/postinstall.js +++ b/postinstall.js @@ -27,7 +27,6 @@ function createTsconfig() { tsconfig.compilerOptions = { module: "commonjs", target: "es5", - sourceMap: true, experimentalDecorators: true, emitDecoratorMetadata: true, noEmitHelpers: true,