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

Commit

Permalink
fix(aot): pass genDir to ng4
Browse files Browse the repository at this point in the history
  • Loading branch information
danbucholtz committed Nov 4, 2017
1 parent e240b2b commit 7506764
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aot/aot-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export async function runAot(context: BuildContext, options: AotOptions) {

const angularCompilerOptions = Object.assign({}, {
basePath: options.rootDir,
genDir: options.rootDir,
entryPoint: options.entryPoint
});

Expand All @@ -38,7 +39,7 @@ export async function runAot(context: BuildContext, options: AotOptions) {
await runNg5Aot(tsConfig, aggregateCompilerOption, compilerHost);
} else {
await runNg4Aot({
angularCompilerOptions: angularCompilerOptions,
angularCompilerOptions: aggregateCompilerOption,
cliOptions: {
i18nFile: undefined,
i18nFormat: undefined,
Expand All @@ -55,7 +56,8 @@ export async function runAot(context: BuildContext, options: AotOptions) {
errorCheckProgram(context, tsConfig, compilerHost, tsProgram);

// update bootstrap in main.ts
const mainFile = context.fileCache.get(changeExtension(options.entryPoint, '.js'));
const mailFilePath = isNg5(context.angularVersion) ? changeExtension(options.entryPoint, '.js') : options.entryPoint;
const mainFile = context.fileCache.get(mailFilePath);
const modifiedBootstrapContent = replaceBootstrap(mainFile, options.appNgModulePath, options.appNgModuleClass, options);
mainFile.content = modifiedBootstrapContent;

Expand Down

0 comments on commit 7506764

Please sign in to comment.