Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 7506764

Browse files
committed
fix(aot): pass genDir to ng4
1 parent e240b2b commit 7506764

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/aot/aot-compiler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export async function runAot(context: BuildContext, options: AotOptions) {
2222

2323
const angularCompilerOptions = Object.assign({}, {
2424
basePath: options.rootDir,
25+
genDir: options.rootDir,
2526
entryPoint: options.entryPoint
2627
});
2728

@@ -38,7 +39,7 @@ export async function runAot(context: BuildContext, options: AotOptions) {
3839
await runNg5Aot(tsConfig, aggregateCompilerOption, compilerHost);
3940
} else {
4041
await runNg4Aot({
41-
angularCompilerOptions: angularCompilerOptions,
42+
angularCompilerOptions: aggregateCompilerOption,
4243
cliOptions: {
4344
i18nFile: undefined,
4445
i18nFormat: undefined,
@@ -55,7 +56,8 @@ export async function runAot(context: BuildContext, options: AotOptions) {
5556
errorCheckProgram(context, tsConfig, compilerHost, tsProgram);
5657

5758
// update bootstrap in main.ts
58-
const mainFile = context.fileCache.get(changeExtension(options.entryPoint, '.js'));
59+
const mailFilePath = isNg5(context.angularVersion) ? changeExtension(options.entryPoint, '.js') : options.entryPoint;
60+
const mainFile = context.fileCache.get(mailFilePath);
5961
const modifiedBootstrapContent = replaceBootstrap(mainFile, options.appNgModulePath, options.appNgModuleClass, options);
6062
mainFile.content = modifiedBootstrapContent;
6163

0 commit comments

Comments
 (0)