Skip to content

Commit

Permalink
fix(frontend): revert lazy route dynamic import generation
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed May 10, 2019
1 parent bed2ae7 commit 0aa7859
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
25 changes: 6 additions & 19 deletions packages/angular/src/schematics/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,7 @@ describe('lib', () => {
expect(moduleContents).toContain(`
{
path: 'my-dir-my-lib',
loadChildren: () =>
import('@proj/my-dir/my-lib').then(module => module.MyDirMyLibModule)
loadChildren: '@proj/my-dir/my-lib#MyDirMyLibModule'
}`);

const tsConfigAppJson = JSON.parse(
Expand Down Expand Up @@ -517,16 +516,12 @@ describe('lib', () => {
expect(moduleContents2).toContain(`
{
path: 'my-dir-my-lib',
loadChildren: () =>
import('@proj/my-dir/my-lib').then(module => module.MyDirMyLibModule)
loadChildren: '@proj/my-dir/my-lib#MyDirMyLibModule'
}`);
expect(moduleContents2).toContain(`
{
path: 'my-dir-my-lib2',
loadChildren: () =>
import('@proj/my-dir/my-lib2').then(
module => module.MyDirMyLib2Module
)
loadChildren: '@proj/my-dir/my-lib2#MyDirMyLib2Module'
}`);

const tsConfigAppJson2 = JSON.parse(
Expand Down Expand Up @@ -561,23 +556,15 @@ describe('lib', () => {
expect(moduleContents3).toContain(`
{
path: 'my-dir-my-lib',
loadChildren: () =>
import('@proj/my-dir/my-lib').then(module => module.MyDirMyLibModule)
loadChildren: '@proj/my-dir/my-lib#MyDirMyLibModule'
}`);
expect(moduleContents3).toContain(`
{
path: 'my-dir-my-lib2',
loadChildren: () =>
import('@proj/my-dir/my-lib2').then(
module => module.MyDirMyLib2Module
)
loadChildren: '@proj/my-dir/my-lib2#MyDirMyLib2Module'
}`);
expect(moduleContents3).toContain(`
{
path: 'my-lib3',
loadChildren: () =>
import('@proj/my-dir/my-lib3').then(module => module.MyLib3Module)
}`);
{ path: 'my-lib3', loadChildren: '@proj/my-dir/my-lib3#MyLib3Module' }`);

const tsConfigAppJson3 = JSON.parse(
stripJsonComments(
Expand Down
6 changes: 3 additions & 3 deletions packages/angular/src/schematics/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ function addLoadChildren(options: NormalizedSchema): Rule {
sourceFile,
`{path: '${toFileName(
options.fileName
)}', loadChildren: () => import('@${npmScope}/${
options.projectDirectory
}').then(module => module.${options.moduleName})}`
)}', loadChildren: '@${npmScope}/${options.projectDirectory}#${
options.moduleName
}'}`
)
]);

Expand Down

0 comments on commit 0aa7859

Please sign in to comment.