-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
38 lines (36 loc) · 1.18 KB
/
vite.config.ts
File metadata and controls
38 lines (36 loc) · 1.18 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
import { defineConfig } from "vite";
import * as path from "path";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { readFileSync } from "fs";
import { fileURLToPath } from "url";
const file = fileURLToPath(new URL("package.json", import.meta.url));
const json = readFileSync(file, "utf8");
const pkg = JSON.parse(json);
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte()],
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
// base: process.env.NODE_ENV === "production" ? "/" : "/designer/",
resolve: {
alias: [
{
find: "#",
replacement: path.resolve("./src"),
},
],
},
// server: {
// headers: {
// "Content-Security-Policy":
// "default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'",
// },
// },
// build: {
// commonjsOptions: {
// // include: ["@abstractplay/renderer", "@abstractplay/renderer/build/schemas/schema", "@abstractplay/renderer/build/renderers/_base", "@abstractplay/renderer/build"],
// include: [],
// },
// }
});