-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: for angular v17, detect publish directory from angular.json
#5373
Conversation
Ooops, looked at the problem the wrong way. This will never work. Sad! |
a322cfe contains an alternative fix! |
angular.json
const angularJson = await this.project.fs.gracefullyReadFile('angular.json') | ||
if (angularJson) { | ||
const { projects, defaultProject } = JSON.parse(angularJson) | ||
const project = projects[defaultProject ?? Object.keys(projects)[0]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this might go slightly wrong if there's more than one project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally! Maybe we should add a warning in case there's multiple projects.
With Angular v17, the publish directory changes based on contents of
angular.json
. It's hard to know this from build-info, but thankfully the build plugin deals with all of that! This PR updates the publish directory to""
, which gives precedence to the value that's defined by the build plugin.