diff --git a/lib/tools/node-modules/node-modules-dest-copy.ts b/lib/tools/node-modules/node-modules-dest-copy.ts index 897c2eebb5..7cca3e24af 100644 --- a/lib/tools/node-modules/node-modules-dest-copy.ts +++ b/lib/tools/node-modules/node-modules-dest-copy.ts @@ -11,6 +11,7 @@ export interface ILocalDependencyData extends IDependencyData { export class TnsModulesCopy { constructor( private outputRoot: string, + private $options: IOptions, private $fs: IFileSystem ) { } @@ -26,12 +27,13 @@ export class TnsModulesCopy { // Remove .ts files let allFiles = this.$fs.enumerateFilesInDirectorySync(tnsCoreModulesResourcePath); - let deleteFilesFutures = allFiles.filter(file => minimatch(file, "**/*.ts", { nocase: true })).map(file => this.$fs.deleteFile(file)); + let matchPattern = this.$options.release ? "**/*.ts" : "**/*.d.ts"; + let deleteFilesFutures = allFiles.filter(file => minimatch(file, matchPattern, { nocase: true })).map(file => this.$fs.deleteFile(file)); Future.wait(deleteFilesFutures); shelljs.rm("-rf", path.join(tnsCoreModulesResourcePath, "node_modules")); - // TODO: The following two lines are necessary to temporarily work around hardcoded + // TODO: The following two lines are necessary to temporarily work around hardcoded // path dependencies in iOS livesync logic. Should be addressed ASAP shelljs.cp("-Rf", path.join(tnsCoreModulesResourcePath, "*"), this.outputRoot); shelljs.rm("-rf", tnsCoreModulesResourcePath);