Files
webstudio/apps/builder/vite.config.ts
T
Ivan Starkov 6cc5c5fff9 fix: Make env compatible across all envs (#3467)
## Description

Having that we use network_mode: service:db
we can use localhost for the db connection string


## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
2024-06-01 09:21:00 +03:00

32 lines
670 B
TypeScript

import { resolve } from "node:path";
import { defineConfig } from "vite";
import { vitePlugin as remix } from "@remix-run/dev";
import { vercelPreset } from "@vercel/remix/vite";
export default defineConfig(({ mode }) => ({
plugins: [
remix({
presets: [vercelPreset()],
}),
],
resolve: {
conditions: ["webstudio", "import", "module", "browser", "default"],
alias: [
{
find: "~",
replacement: resolve("app"),
},
],
},
define: {
"process.env.NODE_ENV": JSON.stringify(mode),
},
ssr: {
external: ["@webstudio-is/prisma-client"],
},
server: {
host: true,
},
envPrefix: "GITHUB_",
}));