Skip to content

Commit

Permalink
Update Angular output path discovery (#10678)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-agius4 committed Oct 27, 2023
1 parent 9e2120a commit 306f653
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-actors-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vercel/frameworks': patch
---

update Angular output path discovery
8 changes: 6 additions & 2 deletions packages/frameworks/src/frameworks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'path';
import { promises } from 'fs';
import { existsSync, promises } from 'fs';

import { Framework } from './types';
import { readConfigFile } from './read-config-file';
Expand Down Expand Up @@ -867,7 +867,11 @@ export const frameworks = [

// If there is only one file in it that is a dir we'll use it as dist dir
if (content.length === 1 && content[0].isDirectory()) {
return join(base, content[0].name);
const potentialOutDir = join(base, content[0].name);
const potentialOutDirWithBrowser = join(potentialOutDir, 'browser');
return existsSync(potentialOutDirWithBrowser)
? potentialOutDirWithBrowser
: potentialOutDir;
}
} catch (error) {
console.error(`Error detecting output directory: `, error);
Expand Down

0 comments on commit 306f653

Please sign in to comment.