Skip to content

Commit 98872bb

Browse files
authored
fix(AoT): use global.require for lazy loading to fix chunk splitting (#153)
1 parent ab940a0 commit 98872bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/ns-module-factory-loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class NsModuleFactoryLoader implements NgModuleFactoryLoader {
4242
private loadAndCompile(modulePath: string, exportName: string): Promise<NgModuleFactory<any>> {
4343
modulePath = getAbsolutePath(modulePath);
4444

45-
let loadedModule = require(modulePath)[exportName];
45+
let loadedModule = global.require(modulePath)[exportName];
4646
checkNotEmpty(loadedModule, modulePath, exportName);
4747

4848
return Promise.resolve(this.compiler.compileModuleAsync(loadedModule));

0 commit comments

Comments
 (0)