generated from the-pudding/svelte-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
30 lines (28 loc) · 921 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
import { readFileSync } from "fs";
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "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());
export default defineConfig({
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"),
$runes: path.resolve("./src/runes"),
$styles: path.resolve("./src/styles"),
$svg: path.resolve("./src/svg"),
$utils: path.resolve("./src/utils")
}
}
});