Skip to content
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

swa deploy does not update staticwebapp.config.json #884

Open
DanielHabenicht opened this issue Aug 21, 2024 · 0 comments
Open

swa deploy does not update staticwebapp.config.json #884

DanielHabenicht opened this issue Aug 21, 2024 · 0 comments

Comments

@DanielHabenicht
Copy link

DanielHabenicht commented Aug 21, 2024

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.
  3. Change the {appLocation}/staticwebapp.config.json
  4. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant