-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
39 lines (38 loc) · 1.15 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { defineConfig } from "vite";
import { resolve } from "path";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { sveltePreprocess } from "svelte-preprocess";
import sitemap from "vite-plugin-sitemap";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
svelte({
preprocess: [
sveltePreprocess({
replace: [
[/process\.env\.APP_BRANCH/g, JSON.stringify(process.env.CF_PAGES_BRANCH || "unknown")],
[
/process\.env\.APP_COMMIT/g,
JSON.stringify(process.env.CF_PAGES_COMMIT_SHA?.substring(0, 7) || "0000000"),
],
],
}),
],
}),
sitemap({
hostname: "https://slicer.run/" /* process.env.CF_PAGES_URL || "http://localhost/" */,
changefreq: "never", // it's an SPA
}),
],
build: {
sourcemap: "hidden",
},
resolve: {
alias: {
$lib: resolve("./src/lib"),
},
},
worker: {
format: "es",
},
});