Skip to content

Commit

Permalink
Add support for Angular 17 and 18 with the new build tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ncamera committed Jun 17, 2024
1 parent 5403f26 commit 9331524
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion libs/ngx-aws-deploy/src/lib/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,26 @@ export default createBuilder(
context.logger.info(`✔ Build Completed`);
}
if (buildResult.success) {
const filesPath = buildResult.outputPath ?? buildResult.outputs[0].path;
let filesPath: string;

// Check if the application uses the ESBuild and Vite based build tool.
// Starting with Angular 18, the build tool name is "@angular/build:application"
if (
buildResult.info?.name ===
"@angular-devkit/build-angular:application" ||
buildResult.info?.name === "@angular/build:application"
) {
// This is a WA since in the new build tool the output path is no longer
// an explicit property of the object
const projectPath = buildResult.info.import.split("\\node_modules")[0];
filesPath = `${projectPath}\\dist\\browser`;
}
// Older versions of Angular that use Webpack or recent version that are
// still based on Webpack
else {
filesPath = buildResult.outputPath ?? buildResult.outputs[0].path;
}

const files = getFiles(filesPath);

if (files.length === 0) {
Expand Down

0 comments on commit 9331524

Please sign in to comment.