Skip to content

Commit

Permalink
fix(effects): make correct export path for testing module (#96)
Browse files Browse the repository at this point in the history
Closes #94
  • Loading branch information
jeffbcross authored and MikeRyanDev committed Jul 18, 2017
1 parent 6982952 commit a5aad22
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion build/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,20 @@ 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 a5aad22

Please sign in to comment.