Skip to content

Commit

Permalink
fix(*): packages are being bundled twice
Browse files Browse the repository at this point in the history
Remove `JavaScript` from `src` folder as this is not required by the consumers with `Angular 4.x.x`, `@ngtools/webpack` and `paths` in `tsconfig.json` it causes the `src` to be bundled togather with the `FESM`.

Closes: ngrx#629
  • Loading branch information
alan-agius4 committed Dec 5, 2017
1 parent 2fbcd24 commit 5aec884
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 5aec884

Please sign in to comment.