-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
69 lines (68 loc) · 2.29 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const { resolve } = require("path");
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import copy from "rollup-plugin-copy";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
"~": resolve(__dirname, "./node_modules/"),
},
},
build: {
manifest: true,
outDir: "static",
rollupOptions: {
plugins: [
copy({
targets: [
// https://github.com/vitejs/vite/issues/1618#issuecomment-764579557
{
src: "./node_modules/@fortawesome/fontawesome-free/webfonts/**/*",
dest: "static/webfonts",
},
{
src: "./node_modules/@fontsource/lato/files/**/*400*-normal*",
dest: "static/webfonts",
},
{
src: "./node_modules/@fontsource/lato/files/**/*700*-normal*",
dest: "static/webfonts",
},
{
src: "./node_modules/@fontsource/raleway/files/**/*400*-normal*",
dest: "static/webfonts",
},
{
src: "./assets/img/**",
dest: "static/img",
},
],
hook: "writeBundle",
}),
],
output: {
manualChunks: {
echarts: ["echarts", "zrender"],
},
},
input: {
index: resolve(__dirname, "assets/js/index.js"),
page: resolve(__dirname, "assets/js/page.js"),
setup: resolve(__dirname, "assets/js/setup.js"),
settings: resolve(__dirname, "assets/js/settings.js"),
challenges: resolve(__dirname, "assets/js/challenges.js"),
scoreboard: resolve(__dirname, "assets/js/scoreboard.js"),
notifications: resolve(__dirname, "assets/js/notifications.js"),
teams_public: resolve(__dirname, "assets/js/teams/public.js"),
teams_private: resolve(__dirname, "assets/js/teams/private.js"),
teams_list: resolve(__dirname, "assets/js/teams/list.js"),
users_public: resolve(__dirname, "assets/js/users/public.js"),
users_private: resolve(__dirname, "assets/js/users/private.js"),
users_list: resolve(__dirname, "assets/js/users/list.js"),
main: resolve(__dirname, "assets/scss/main.scss"),
},
},
},
});