angular-cli-ghpages: Wrong publish folder for new `application` builder in Angular V17
Angular V17 now use the application
builder by default (ref) even if we don’t use SSR. This results in the output files, including index.html
, be placed in ${outputPath}/browser
instead of ${outputPath}
, which breaks the deployment of angular-cli-ghpages
.
I propose two potential solutions:
-
Add a deployment options to specify a relative path to
outputPath
. e.g.ng deploy --path=/browser
, which publishes folder${outputPath}/browser
. -
If
build.builder
inangular.json
is set to “@angular-devkit/build-angular:application”, then publishes folder${outputPath}/browser
.
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Reactions: 8
- Comments: 19 (11 by maintainers)
Using the standalone command, it is possible to use the
--dir
parameter to specify the output path.See reference here: https://github.com/angular-schule/angular-cli-ghpages/blob/main/docs/README_standalone.md#usage-with-angular-cli-6-or-higher
🎉
The builder for
ng deploy
was supposed to work “out of the box” without further configuration. Since the builder also performs the application build, the script itself needs to find out the dist folder path without configuration from outside. This is why we don’t offer thedir
option for the deployment builder.However, this came from a time where
build-angular:browser
was the only official application builder. Now that there are at least two of them, we have to re-evaluate this. The two solutions proposed above by @david20571015 sound reasonable, and we’ll discuss soon how we can do this properly. If you have any more input or ideas about this, please let us know.For now, we recommend using the standalone command as described above by @jfcere .
Looks like the angularfire team has now changed their setup like this: https://github.com/angular/angularfire/blob/master/package.json
only dependencies and devDependencies, no peerDependencies any longer. And they skipped all previous version, too. So I think I will try this out too:
FROM
TO
I will push a new beta.2 version very soon. @david20571015 Could you please try out an installation again, ideally with your “bogus” setup, too? (having @angular-devkit/architect in the dependencies)