generated from the-pudding/svelte-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
31 lines (28 loc) · 896 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
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"),
$routes: path.resolve("./src/routes"),
$stores: path.resolve("./src/stores"),
$styles: path.resolve("./src/styles"),
$svg: path.resolve("./src/svg"),
$utils: path.resolve("./src/utils")
}
}
};
export default config;