When running ng deploy the project runs a specified target before deploying.
The target is specified in azure.json under hosting[i].app.target, and an optional configuration under hosting[i].app.configuration. The default is hosting[i].app.target = "build" and hosting[i].app.configuration = "production".
Then the files are fetched from the path specified in the target's configuration in angular.json under outputPath. If an outputPath is not specified, or a build target is not specified in azure.json, a path where the files to be deployed exist must be provided in azure.json instead.
The purpose of this change is to make sure the deployed files are the latest version of the application, while allowing the users to configure a different build strategy.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] This change requires a documentation update
How to Test
Default:
Create an Angular app
Run ng add @azure/ng-deploy
Run ng deploy. See that the project is built in production mode and deployed.
Make changes to the app.
Run ng deploy. See that the project is built again in production mode and deployed.
Change target
Add a target to angular.json (under architecture) or change the name of the build target.
Optional: add configuration to the target, or change the name of the production configuration.
Edit azure.json accordingly.
Run ng deploy. See that the project is built again in production mode and deployed.
No target, use path
Remove the target configuration in azure.json
Instead, add path pointing to the location of the files, relative to the project's folder.
Run ng deploy. See that the files in the specified path are deployed.
Description
When running
ng deploy
the project runs a specified target before deploying.The target is specified in
azure.json
underhosting[i].app.target
, and an optional configuration underhosting[i].app.configuration
. The default ishosting[i].app.target = "build"
andhosting[i].app.configuration = "production"
.Then the files are fetched from the path specified in the target's configuration in
angular.json
underoutputPath
. If anoutputPath
is not specified, or a build target is not specified inazure.json
, apath
where the files to be deployed exist must be provided inazure.json
instead.The purpose of this change is to make sure the deployed files are the latest version of the application, while allowing the users to configure a different build strategy.
Type of change
How to Test
Default:
ng add @azure/ng-deploy
ng deploy
. See that the project is built in production mode and deployed.ng deploy
. See that the project is built again in production mode and deployed.Change target
angular.json
(underarchitecture
) or change the name of thebuild
target.production
configuration.azure.json
accordingly.ng deploy
. See that the project is built again in production mode and deployed.No target, use path
target
configuration inazure.json
path
pointing to the location of the files, relative to the project's folder.ng deploy
. See that the files in the specified path are deployed.Closing issues
Closes #23 Reference: https://github.com/angular-schule/ngx-deploy-starter/issues/1#ref-commit-286aadd