Skip to content

(AngularCompilerPlugin) AOT with lazy modules without angular/router #8142

Closed
@bukharin

Description

@bukharin

Hi,

I try to enable AOT compilation in our project with lazy modules. We do not use @angular/router and lazy modules loads like this:

require.ensure([], () => {
                        resolve(require("../+profile/profile.module.ts")["ProfileModule"]);
                    }, err => reject(err), "profile");

At runtime I discover that AngularCompilerPlugin do not override ProfileModule to ProfileModuleNgFactory. The plugin can not determine lazy modules in our application because we don't use angular/router and instantinate modules by using angular low level api for that (like router).

How can I achieve this?

I think the best way is to remove explicit binding from @angular/router for determining lazy modules. Also you can provide additional options for explicit lazy modules config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions