-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
47 lines (44 loc) · 1.19 KB
/
vite.config.js
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
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import svelteSVG from "vite-plugin-svelte-svg";
import sveltePreprocess from "svelte-preprocess";
import path from "path";
const mode = Object.freeze({
dev: "development",
prod: "production",
});
const root = process.cwd();
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => ({
root: root,
resolve: {
alias: {
"@lib": path.resolve(root, "src", "lib"),
"@js": path.resolve(root, "src", "lib", "js"),
"@routes": path.resolve(root, "src", "routes"),
"@assets": path.resolve(root, "src", "assets"),
"@styles": path.resolve(root, "src", "styles"),
},
extensions: [".mjs", ".js", ".ts", ".tsx", ".json", ".scss", ".css"],
},
plugins: [
svelteSVG({
svgoConfig: {}, // See https://github.com/svg/svgo#configuration
}),
svelte({
compilerOptions: {
accessors: true,
},
preprocess: sveltePreprocess({
sourceMap: mode === mode.dev,
}),
}),
],
css: {
preprocessorOptions: {
scss: {
includePaths: ["src/theme", "node_modules", "src/styles"],
},
},
},
}));