-
Notifications
You must be signed in to change notification settings - Fork 136
FAQ
What's the "context" and how does that differ from appLocation or outputLocation?
context determines how the emulator will serve the static content:
- if
contextis a folder, then we will start the emulator and serve static content from that folder - if
contextis an HTTP address, then we will start the emulator and proxy req to the dev server
In both cases, we reconfigure appLocation and outputLocation to reflect that:
outputLocation= context-
appLocation = cwd()(currently, we don't useappLocationifcontextis a dev server)
swa start <context>
When not provided, context maps to the pwd:
swa start ./
We use commander under the hood to implement commands. In our use case, context (a command) will take precedence over --app-location (an option or a flag).
The scans scans for azure-static-web-apps-**.yml files under cwd()/.github/workflows/, and picks the 1st one (non-deterministic!).
app_build_command
api_build_command
app_location
output_location
api_location
These values are overridden by the user's config (CLI flags).
We check for runtime type. We currently support Node.js and .NET:
- For Node.js,
- For app, we invoke
npm install && <app_build_command> - For api we invoke
npm install && <api_build_command>
- For app, we invoke
- For .NET,
- We invoke
dotnet build
- We invoke
Important: We don't build if context is a dev server.
We scan recursively the appLocation for staticwebapp.config.json (or the legacy file routes.json):
- If we find both
staticwebapp.config.jsonandroutes.json, we pickstaticwebapp.config.json. - If we find only
routes.json, verify it's a valid SWA config file (some JS frameworks use the same filename for routing) then pick it.