-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsvelte.config.js
More file actions
67 lines (58 loc) · 1.5 KB
/
svelte.config.js
File metadata and controls
67 lines (58 loc) · 1.5 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { mdsvex } from "mdsvex"
import mdsvexConfig from "./mdsvex.config.js"
import preprocess from "svelte-preprocess"
import { resolve } from "path"
import adapter from "@sveltejs/adapter-node"
import dotenv from "dotenv"
import dynamicImportVars from "@rollup/plugin-dynamic-import-vars"
await dotenv.config();
const prod = process.env["NODE_ENV"] === "production";
/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: [".svelte", ...mdsvexConfig.extensions],
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [preprocess(), mdsvex(mdsvexConfig)],
kit: {
adapter: adapter({
out: "build"
}),
alias: {
$assets: "./src/assets",
$content: './src/content',
$components: './src/components',
$models: './src/models',
$formElements: './src/components/forms/elements',
$brandIcons: './src/components/icons/brands'
},
vite: {
envPrefix: "CLIENT_",
plugins: [
// Source: https://github.com/sveltejs/kit/issues/3030
(function LoadSecrets() {
return {
name: "load-secrets",
configureServer: async () => {
; (await import('dotenv')).config()
}
}
})(),
dynamicImportVars({
include: [
"./src/lib/loadContents.js"
]
})
]
},
},
onwarn: (warning, handler) => {
const { code, message } = warning;
if (code === "css-unused-selector") {
// ignores this warning
return;
} else {
handler(warning);
}
}
};
export default config;