Skip to content

Commit

Permalink
Merge pull request #1189 from NativeScript/vladimirov/skip-d-ts-core-…
Browse files Browse the repository at this point in the history
…modules

Remove .ts from tns-core-modules package when moving it to platforms dir
  • Loading branch information
rosen-vladimirov committed Nov 16, 2015
2 parents 0cedf90 + 1407af7 commit fed257f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/tools/broccoli/node-modules-dest-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as semver from "semver";
import * as shelljs from "shelljs";
import {wrapBroccoliPlugin} from './broccoli-plugin-wrapper-factory';
import * as constants from "../../constants";
import * as minimatch from "minimatch";
import Future = require("fibers/future");

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

if (dependency.name === constants.TNS_CORE_MODULES_NAME) {
let tnsCoreModulesResourcePath = path.join(this.outputRoot, constants.TNS_CORE_MODULES_NAME);

// 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));
Future.wait(deleteFilesFutures);

shelljs.cp("-Rf", path.join(tnsCoreModulesResourcePath, "*"), this.outputRoot);
this.$fs.deleteDirectory(tnsCoreModulesResourcePath).wait();
}
Expand Down

0 comments on commit fed257f

Please sign in to comment.