I am using Azure Devops to deploy Angular 6 + asp.net application.
ng build --prod command perfectly deploying to destination folder which is in outputPath of angular.json
During release definition(CD), we need to clear all the files in the existing outputPath.
Because existing web deployment already having main.{oldhashvalue}.js.
if I am doing next release definition then it adds another main.{newhashvalue}.js to the same outputPath.
This creates the issue that the application still refers the old main.{oldhashvalue}.js.
So, how to clean old outputPath before the next deploy during release definition?
Here is the YAML format of release definition
steps:
task: AzureRmWebAppDeployment@3
displayName: 'Deploy Azure App Service to Slot'
inputs:
azureSubscription: 'azureSubscription - Service Endpoint'
WebAppName: firstwebappname
DeployToSlotFlag: true
ResourceGroupName: firstresourcegroupname
SlotName: dev
Package: '$(System.DefaultWorkingDirectory)***.zip'
TakeAppOfflineFlag: true
UseWebDeploy: true
RenameFilesFlag: true
I already tried enabling "Remove additional files at destination" option but it clears the node_modules folder which is needed always. Don't wanted to install all the time.