generated from yizhe-ang/svelte-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
vite.config.js
34 lines (31 loc) · 877 Bytes
/
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
import { readFileSync } from "fs";
import { sveltekit } from '@sveltejs/kit/vite';
import { timeFormat } from "d3";
import path from "path";
import svg from "vite-plugin-svgstring";
import dsv from "@rollup/plugin-dsv";
const { version } = JSON.parse(readFileSync("package.json", "utf8"));
const timestamp = timeFormat("%Y-%m-%d-%H:%M")(new Date());
const config = {
define: {
__VERSION__: JSON.stringify(version),
__TIMESTAMP__: JSON.stringify(timestamp)
},
plugins: [
sveltekit(),
dsv(),
svg()
],
resolve: {
alias: {
"$actions": path.resolve("./src/actions"),
"$components": path.resolve("./src/components"),
"$data": path.resolve("./src/data"),
"$stores": path.resolve("./src/stores"),
"$styles": path.resolve("./src/styles"),
"$svg": path.resolve("./src/svg"),
"$utils": path.resolve("./src/utils")
}
}
};
export default config;