add env build configuration

This commit is contained in:
Ruben Fiszel
2023-03-14 22:16:22 +01:00
parent 801e9467a9
commit c442ea0942
4 changed files with 32 additions and 10 deletions
+1
View File
@@ -0,0 +1 @@
VITE_DEFAULT_WEBHOOK_TYPE=async
+20 -1
View File
@@ -17,7 +17,7 @@ In the root folder:
```bash
docker build . -t windmill
docker-compose up db windmill_server windmill_worker
docker compose up db windmill_server windmill_worker
```
### 2. Backend is run by cargo
@@ -145,3 +145,22 @@ Recommended config for VS Code:
```
- turn _format on save_ on
## Building
The project is built with [SvelteKit](https://kit.svelte.dev/) and uses as output static files.
There are others adapters for sveltekit, but we use the static adapter.
To build the frontend as static assets, use:
```
npm run build
```
The default build assume you serve every non static files as the 200.html file which is catchall. If you prefer a normal layout, you can use the :
```
NOTCATCHALL=true npm run build
```
Env variables used for build are set in .env file. See [https://vitejs.dev/guide/env-and-mode.html#env-files](https://vitejs.dev/guide/env-and-mode.html#env-files) for more details.
+2 -1
View File
@@ -1 +1,2 @@
export const DEFAULT_WEBHOOK_TYPE: 'async' | 'sync' = 'async'
export const DEFAULT_WEBHOOK_TYPE: 'async' | 'sync' =
import.meta.env.VITE_DEFAULT_WEBHOOK_TYPE || 'async'
+9 -8
View File
@@ -12,14 +12,15 @@ const config = {
],
kit: {
adapter: process.env.CLOUDFLARE
? adapter({ pages: 'build', assets: 'build', fallback: 'index.html', precompress: false })
: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: '200.html'
}),
adapter:
process.env.CLOUDFLARE || process.env.NOCATCHALL
? adapter({ pages: 'build', assets: 'build', fallback: 'index.html', precompress: false })
: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: '200.html'
}),
prerender: { entries: [] }
}
}