From 3250ea1d9facbb0e03bf2cf8e01069b5bc85209a Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:56:45 +0530 Subject: [PATCH] Configure Vite for base path and add static web app configuration with navigation fallback and global headers --- staticwebapp.config.json | 18 ++++++++++++++++++ vite.config.ts | 1 + 2 files changed, 19 insertions(+) create mode 100644 staticwebapp.config.json diff --git a/staticwebapp.config.json b/staticwebapp.config.json new file mode 100644 index 0000000..069158c --- /dev/null +++ b/staticwebapp.config.json @@ -0,0 +1,18 @@ +{ + "navigationFallback": { + "rewrite": "/index.html", + "exclude": ["/images/*.{png,jpg,gif}", "/css/*", "/js/*", "/api/*"] + }, + "routes": [ + { + "route": "/*", + "serve": "/index.html", + "statusCode": 200 + } + ], + "globalHeaders": { + "content-security-policy": "default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'", + "cache-control": "no-cache", + "Access-Control-Allow-Origin": "*" + } +} \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index bc400a6..ac6fa68 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,6 +7,7 @@ export default defineConfig({ global: 'globalThis', 'process.env': process.env }, + base: '/', resolve: { alias: { 'stream': 'stream-browserify',