Skip to content

Commit 1abb8d4

Browse files
committed
Enable runtime build by default
1 parent 0cab665 commit 1abb8d4

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

.diploi/helm/app.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ spec:
6666
{{- end }}
6767
{{- if and (ne .Values.stage "development")
6868
(hasKey .Values.storage "build")
69-
(hasKey .Values.envMap "__VITE_RUNTIME_BUILD")
70-
(eq (toString (default "" ((index .Values.envMap "__VITE_RUNTIME_BUILD").value))) "true") }}
69+
(eq (toString (default "true" ((index .Values.envMap "__VITE_RUNTIME_BUILD").value))) "true") }}
7170
initContainers:
7271
- name: runtime-build
7372
securityContext:
@@ -141,8 +140,7 @@ spec:
141140
{{- end }}
142141
{{- if and (ne .Values.stage "development")
143142
(hasKey .Values.storage "build")
144-
(hasKey .Values.envMap "__VITE_RUNTIME_BUILD")
145-
(eq (toString (default "" ((index .Values.envMap "__VITE_RUNTIME_BUILD").value))) "true") }}
143+
(eq (toString (default "true" ((index .Values.envMap "__VITE_RUNTIME_BUILD").value))) "true") }}
146144
- name: build-mount
147145
mountPath: /app
148146
{{- end }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ARG FOLDER=/app
33

44
# This will be set by the GitHub action if "__VITE_RUNTIME_BUILD" ENV is set in diploi.yaml
5-
ARG __VITE_RUNTIME_BUILD=false
5+
ARG __VITE_RUNTIME_BUILD=true
66

77
FROM node:24-slim AS base
88

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Since Vite embeds environment variables during the build step, we provide two wa
4343

4444
#### Runtime Build
4545

46-
When runtime build is enabled, `npm run build` is executed again when the container starts. This ensures that environment variables from the running deployment are correctly applied, and that any data loaded from other components can use the internal network.
46+
When runtime build is enabled (which it is by default), `npm run build` is executed again when the container starts. This ensures that environment variables from the running deployment are correctly applied, and that any data loaded from other components can use the internal network.
4747

48-
To enable runtime build, set `__VITE_RUNTIME_BUILD` to `true` in `diploi.yaml`:
48+
To disable runtime build, set `__VITE_RUNTIME_BUILD` to `false` in `diploi.yaml`:
4949

5050
```yaml
5151
- name: React + Vite
@@ -54,7 +54,7 @@ To enable runtime build, set `__VITE_RUNTIME_BUILD` to `true` in `diploi.yaml`:
5454
env:
5555
include:
5656
- name: __VITE_RUNTIME_BUILD
57-
value: true
57+
value: false
5858
```
5959
6060
## Links

0 commit comments

Comments
 (0)