Azure / Azure/static-web-apps-cli
`swa deploy` does not update `staticwebapp.config.json`
- Lingua principale
- TypeScript
- Stelle
- 668
- Fork
- 156
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**Describe the bug**
When changing the `{appLocation}/staticwebapp.config.json` file and redeploying it (`swa deploy`) without rebuilding the application every time (e.g. for configuring routing or authentication) the configuration file inside the `{outputLocation}/staticwebapp.config.json` is not updated and thus subsequent changes are not applied to the static web app.
**To Reproduce**
Steps to reproduce the behavior:
1. Build an app
2. Type in command `swa deploy`
- Notice how the configured `{appLocation}/staticwebapp.config.json` is copied to `{outputLocation}/staticwebapp.config.json`.
4. Change the `{appLocation}/staticwebapp.config.json`
5. Type in command `swa deploy`
- The `{outputLocation}/staticwebapp.config.json` is not overriden but stays the same as before.
**Expected behavior**
`staticwebapp.config.json` in the dist folder should be overridden with the configured one before each deployment.
**Screenshots**
If applicable, add screenshots to help explain your problem.
```
{
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
"configurations": {
"project": {
"appLocation": ".",
"outputLocation": "dist",
"appBuildCommand": "npm run build",
"run": "npm run dev",
"appDevserverUrl": "http://localhost:5173"
}
}
}
```
**Desktop (please complete the following information):**
- OS: Windows
- Version 11
- @azure/static-web-apps-cli: 2.0.1
**Additional context**
Add any other context about the problem here.
Just found it in the verbose output. If not file exists it seems to be copied, but otherwise this log output is missing:
```
Copying 'staticwebapp.config.json' to build output
```
**Workaround**
`rm {outputFolder}/staticwebapp.config.json && swa deploy`
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Riproduci il problema con `swa deploy` modificando `{appLocation}/staticwebapp.config.json` dopo la build iniziale, quindi ispeziona il percorso di deployment che gestisce `{outputLocation}/staticwebapp.config.json`. Confronta l'output dettagliato con il comportamento di copia documentato. L'attività è completata quando ogni deployment riflette il file di configurazione corrente senza dover eliminare manualmente la copia nella directory di output.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, typescript
- Ambito
- cli, cloud
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100