Skip to content

Commit 40212b8

Browse files
committed
feat: add staticwebapp.config.json copy to build process and update navigationFallback exclusions
1 parent a3e0432 commit 40212b8

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

rsbuild.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ export default defineConfig({
123123
from: path.resolve(PUBLIC_DIR, APP_CONFIG),
124124
to: 'app-config.js',
125125
},
126+
// Copy staticwebapp.config.json for Azure Static Web Apps
127+
{
128+
from: path.resolve(__dirname, 'staticwebapp.config.json'),
129+
to: `${DIST_DIR}/staticwebapp.config.json`,
130+
},
126131
],
127132
},
128133
html: {

staticwebapp.config.json

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
{
2-
"routes": [
3-
{
4-
"route": "/viewer/*",
5-
"serve": "/index.html",
6-
"statusCode": 200
7-
},
8-
{
9-
"route": "/*",
10-
"serve": "/index.html",
11-
"statusCode": 200
12-
}
13-
],
142
"navigationFallback": {
153
"rewrite": "/index.html",
16-
"exclude": ["/api/*", "*.{css,scss,js,png,gif,ico,jpg,svg,woff,woff2,ttf,eot}"]
4+
"exclude": [
5+
"/api/*",
6+
"*.{css,scss,js,jsx,ts,tsx,json,wasm,png,jpg,jpeg,gif,svg,ico,woff,woff2,ttf,eot,map,webp}"
7+
]
178
},
189
"mimeTypes": {
1910
".json": "application/json",

0 commit comments

Comments
 (0)