The regular expression for replacing loadChildren matches any string in the following format:
loadChildren: 'xxx'
This causes a problem with angular-tree-component when compiling the app with AOT. This is because that component has loadChildren property property and AOT produces an ngfactory.ts file that contains loadChildren: 'loadChildren' that gets replaced by the loader causing the compilation to fail.
This can be fixed by changing the regular expression to include the # symbol (since all lazy routes seem to require the module name separated by that symbol):
The regular expression for replacing
loadChildren
matches any string in the following format:This causes a problem with angular-tree-component when compiling the app with AOT. This is because that component has
loadChildren
property property and AOT produces anngfactory.ts
file that containsloadChildren: 'loadChildren'
that gets replaced by the loader causing the compilation to fail.This can be fixed by changing the regular expression to include the
#
symbol (since all lazy routes seem to require the module name separated by that symbol):