Files
angular__angular/tools/package-tools/copy-files.ts
T
Paul Gschwendtner 2320532516 build: no longer add pure annotations to es5 bundles (#6107)
* The pure annotations are no longer added to ES5 bundles of Angular Material or the CDK. The pure annotations should be added by the new build optimizer which is part of the CLI.
2017-08-01 12:48:08 -07:00

13 lines
475 B
TypeScript

import {sync as glob} from 'glob';
import {mkdirpSync, copySync} from 'fs-extra';
import {join, dirname} from 'path';
/** Function to copy files that match a glob to another directory. */
export function copyFiles(fromPath: string, fileGlob: string, outDir: string) {
glob(fileGlob, {cwd: fromPath}).forEach(filePath => {
const fileDestPath = join(outDir, filePath);
mkdirpSync(dirname(fileDestPath));
copySync(join(fromPath, filePath), fileDestPath);
});
}