mirror of
https://github.com/Floriansylvain/creative_coding_1.git
synced 2026-08-19 11:43:20 +02:00
26 lines
565 B
JavaScript
26 lines
565 B
JavaScript
import { defineConfig } from "vite"
|
|
|
|
const isCodeSandbox = "SANDBOX_URL" in process.env || "CODESANDBOX_HOST" in process.env
|
|
|
|
export default defineConfig(({ command }) => {
|
|
const baseUrl =
|
|
command === "serve" ? "https://projet.floriansylvain.fr/Creative_Coding" : ""
|
|
|
|
return {
|
|
define: {
|
|
BASE_URL: JSON.stringify(baseUrl),
|
|
},
|
|
root: "src/",
|
|
publicDir: "../static/",
|
|
base: "/Creative_Coding/",
|
|
server: {
|
|
host: true,
|
|
open: !isCodeSandbox, // Open if it's not a CodeSandbox
|
|
},
|
|
build: {
|
|
outDir: "../dist",
|
|
emptyOutDir: true,
|
|
},
|
|
}
|
|
})
|