You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,30 @@ Oryx, Azure's build system, may attempt to build your application with an EOL ve
53
53
}
54
54
```
55
55
56
+
### CUSTOM_BUILD_COMMAND
57
+
58
+
If `CUSTOM_BUILD_COMMAND` is not provided to the github action, the [azure swa github action](https://docs.microsoft.com/en-us/azure/static-web-apps/build-configuration?tabs=github-actions) runs the following (as of 03.03.2025)
59
+
60
+
```yaml
61
+
npm install # this could lead to differences in final used dependencies
62
+
npm run build
63
+
npm run build:azure # Although according to docs "...the workflow tries to run the npm run build or npm run build:azure commands"
64
+
npm install # in build/server
65
+
```
66
+
67
+
If you wish to control that `npm ci` is executed instead of `npm install`, define the `CUSTOM_BUILD_COMMAND` environment variable for the build in combination with `skip_api_build: true`. In this case you will need to execute `npm install` in the `build/server` directory with api functions manually.
68
+
69
+
```yaml
70
+
...
71
+
env:
72
+
# npm install in build/server should be executed manually
73
+
# or execute npm ci before this action
74
+
CUSTOM_BUILD_COMMAND: "npm ci && npm run build && npm install --prefix ./build/server --omit=dev"
75
+
with:
76
+
skip_api_build: true
77
+
...
78
+
```
79
+
56
80
## Running locally with the Azure SWA CLI
57
81
58
82
You can debug using the [Azure Static Web Apps CLI](https://github.com/Azure/static-web-apps-cli). Note that the CLI is currently in preview and you may encounter issues.
0 commit comments