Skip to content

Commit

Permalink
fix(effects): make correct export path for testing module
Browse files Browse the repository at this point in the history
Closes ngrx#94
  • Loading branch information
jeffbcross committed Jul 18, 2017
1 parent 6982952 commit 8480583
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ export async function compilePackagesWithNgc(config: Config) {
async function _compilePackagesWithNgc(pkg: string) {
await util.exec('ngc', [`-p ./modules/${pkg}/tsconfig-build.json`]);

const entryTypeDefinition = `export * from './${pkg}/index';`;
/**
* Test modules are treated differently because nested inside top-level.
* This step removes the top-level package from testing modules from the
* export statement.
* Also changes the module name from 'index' to 'testing'
* i.e. export * from './effects/testing/index' becomes './testing/testing';
*
* See https://github.com/ngrx/platform/issues/94
*/
//
let [exportPath, moduleName] = /\/testing$/.test(pkg) ? [pkg.replace(/(.*\/)testing/i, 'testing'), 'testing'] : [pkg, 'index'];

const entryTypeDefinition = `export * from './${exportPath}/${moduleName}';`;
const entryMetadata = `{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./${pkg}/index"}]}`;

await Promise.all([
Expand Down

0 comments on commit 8480583

Please sign in to comment.