Skip to content

Commit fed257f

Browse files
Merge pull request #1189 from NativeScript/vladimirov/skip-d-ts-core-modules
Remove .ts from tns-core-modules package when moving it to platforms dir
2 parents 0cedf90 + 1407af7 commit fed257f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/tools/broccoli/node-modules-dest-copy.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import * as semver from "semver";
77
import * as shelljs from "shelljs";
88
import {wrapBroccoliPlugin} from './broccoli-plugin-wrapper-factory';
99
import * as constants from "../../constants";
10+
import * as minimatch from "minimatch";
11+
import Future = require("fibers/future");
1012

1113
/**
1214
* Intercepts each directory as it is copied to the destination tempdir,
@@ -79,6 +81,12 @@ export class DestCopy implements IBroccoliPlugin {
7981

8082
if (dependency.name === constants.TNS_CORE_MODULES_NAME) {
8183
let tnsCoreModulesResourcePath = path.join(this.outputRoot, constants.TNS_CORE_MODULES_NAME);
84+
85+
// Remove .ts files
86+
let allFiles = this.$fs.enumerateFilesInDirectorySync(tnsCoreModulesResourcePath);
87+
let deleteFilesFutures = allFiles.filter(file => minimatch(file, "**/*.ts", {nocase: true})).map(file => this.$fs.deleteFile(file));
88+
Future.wait(deleteFilesFutures);
89+
8290
shelljs.cp("-Rf", path.join(tnsCoreModulesResourcePath, "*"), this.outputRoot);
8391
this.$fs.deleteDirectory(tnsCoreModulesResourcePath).wait();
8492
}

0 commit comments

Comments
 (0)