Skip to content

Commit a4736e1

Browse files
authored
Merge pull request #23 from NativeScript/jasssonpet/chrome-devtools-sourcemaps
Use inline source maps for Chrome DevTools debugging
2 parents f656746 + 78bde70 commit a4736e1

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Diff for: lib/before-prepare.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports = function ($logger, $projectData, $usbLiveSyncService) {
66
if (liveSync || bundle) {
77
return;
88
}
9-
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir);
9+
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { release: $projectData.$options.release });
1010
}

Diff for: lib/compiler.js

+9
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ function runTypeScriptCompiler(logger, projectDir, options) {
2828
nodeArgs.push('--watch');
2929
}
3030

31+
if (!options.release) {
32+
// For debugging in Chrome DevTools
33+
nodeArgs.push(
34+
'--sourceMap', 'false',
35+
'--inlineSourceMap', 'true',
36+
'--inlineSources', 'true'
37+
);
38+
}
39+
3140
var tsc = spawn(process.execPath, nodeArgs);
3241
var isResolved = false;
3342
tsc.stdout.on('data', function(data) {

Diff for: lib/watch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var compiler = require('./compiler');
22

33
module.exports = function ($logger, $projectData, $errors) {
4-
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { watch: true });
4+
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { watch: true, release: $projectData.$options.release });
55
}

Diff for: postinstall.js

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ function createTsconfig() {
2727
tsconfig.compilerOptions = {
2828
module: "commonjs",
2929
target: "es5",
30-
sourceMap: true,
3130
experimentalDecorators: true,
3231
emitDecoratorMetadata: true,
3332
noEmitHelpers: true,

0 commit comments

Comments
 (0)