Skip to content

Commit

Permalink
chore(build): Remove compiled source files from build output (#630)
Browse files Browse the repository at this point in the history
Closes: #629
  • Loading branch information
alan-agius4 authored and brandonroberts committed Dec 6, 2017
1 parent 2fbcd24 commit b7a554a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default createBuilder([
['Creating UMD Bundles', tasks.createUmdBundles],
['Renaming package entry files', tasks.renamePackageEntryFiles],
['Cleaning TypeScript files', tasks.cleanTypeScriptFiles],
['Cleaning JavaScript files', tasks.cleanJavaScriptFiles],
['Removing remaining sourcemap files', tasks.removeRemainingSourceMapFiles],
['Copying type definition files', tasks.copyTypeDefinitionFiles],
['Minifying UMD bundles', tasks.minifyUmdBundles],
Expand Down
15 changes: 15 additions & 0 deletions build/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,21 @@ export async function cleanTypeScriptFiles(config: Config) {
await mapAsync(filesToRemove, util.remove);
}

/**
* Removes any leftover Javascript files from previous compilation steps,
* leaving the bundles and FESM in place
*/
export async function cleanJavaScriptFiles(config: Config) {
const jsFilesGlob = './dist/packages/**/*.js';
const jsExcludeFilesFlob = './dist/packages/(bundles|@ngrx)/**/*.js';
const filesToRemove = await util.getListOfFiles(
jsFilesGlob,
jsExcludeFilesFlob
);

await mapAsync(filesToRemove, util.remove);
}

/**
* Renames the index files in each package to the name
* of the package.
Expand Down

0 comments on commit b7a554a

Please sign in to comment.