Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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