Skip to content

Commit 3d8d32f

Browse files
committed
Use moduleResolution classic when --syncAllFiles option is not specified
Fixes NativeScript/nativescript-cli#3378
1 parent d152f80 commit 3d8d32f

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

bin/ns-upgrade-tsconfig

100644100755
File mode changed.

lib/before-prepare.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ module.exports = function ($logger, $projectData, $options, hookArgs) {
1111
}
1212

1313
var release = $options.release || appFilesUpdaterOptions.release;
14-
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { release });
14+
var watchAllFiles = ($options && $options.syncAllFiles) || appFilesUpdaterOptions.watchAllFiles;
15+
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { release, watchAllFiles });
1516
}

lib/compiler.js

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ function runTypeScriptCompiler(logger, projectDir, options) {
3535
nodeArgs.push('--inlineSourceMap', '--inlineSources');
3636
}
3737

38+
if (!options.watchAllFiles) {
39+
nodeArgs.push('--moduleResolution', 'classic');
40+
}
41+
3842
logger.trace(process.execPath, nodeArgs.join(' '));
3943
tsc = spawn(process.execPath, nodeArgs);
4044

lib/watch.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ module.exports = function ($logger, $projectData, $errors, hookArgs) {
99
}
1010
}
1111

12-
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { watch: true, release: $projectData.$options.release });
12+
const watchAllFiles = hookArgs && hookArgs.config && hookArgs.config.appFilesUpdaterOptions && hookArgs.config.appFilesUpdaterOptions.watchAllFiles;
13+
14+
return compiler.runTypeScriptCompiler($logger, $projectData.projectDir, { watch: true, release: $projectData.$options.release, watchAllFiles: watchAllFiles });
1315
}

0 commit comments

Comments
 (0)