forked from rajnandan1/kener
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
48 lines (39 loc) · 1.08 KB
/
svelte.config.js
File metadata and controls
48 lines (39 loc) · 1.08 KB
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
40
41
42
43
44
45
46
47
48
import adapter from "@sveltejs/adapter-node";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import * as dotenv from "dotenv";
dotenv.config();
const basePath = process.env.KENER_BASE_PATH ? process.env.KENER_BASE_PATH : "";
const buildEnv = process.env.VITE_BUILD_ENV || process.env.NODE_ENV || "development";
const isProduction = buildEnv === "production";
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [vitePreprocess({})],
kit: {
adapter: adapter(),
paths: {
base: basePath,
},
csrf: {
trustedOrigins: ["*"],
},
},
compilerOptions: {
dev: !isProduction,
sourcemap: !isProduction,
},
onwarn: (warning, handler) => {
// Suppress specific warnings in production
const ignoredWarnings = [
"a11y-",
"unused-export-let",
"empty-chunk",
"module-unused-import",
"conflicting-svelte-resolve",
];
if (isProduction && warning.code && ignoredWarnings.some((w) => warning.code.startsWith(w))) {
return;
}
handler(warning);
},
};
export default config;