-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
74 lines (72 loc) · 1.91 KB
/
vite.config.ts
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
70
71
72
73
74
import path from "path";
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
import ViteFonts from "vite-plugin-fonts";
const sourcemap: any = {
development: "inline",
staging: "inline",
production: true,
};
export default defineConfig(({ mode }) => ({
plugins: [
vue(),
ViteFonts({
google: {
families: [
"Material+Icons",
{
name: "Noto+Sans+JP",
styles: "wght@400;500;700",
},
],
},
}),
],
resolve: {
alias: {
"~": path.resolve(__dirname, "src"),
},
},
build: {
sourcemap: sourcemap[mode],
rollupOptions: {
// https://rollupjs.org/guide/en/#outputmanualchunks
output: {
manualChunks: {
main: ["./src/ui/main.ts"],
nav: [
"./src/ui/pages/course/_id/edit.vue",
"./src/ui/pages/course/_id/index.vue",
"./src/ui/pages/credit/index.vue",
"./src/ui/pages/credit/_id.vue",
"./src/ui/pages/add/csv.vue",
"./src/ui/pages/add/index.vue",
"./src/ui/pages/add/manual.vue",
"./src/ui/pages/add/search.vue",
"./src/ui/pages/add/twins.vue",
"./src/ui/pages/feedback.vue",
"./src/ui/pages/news.vue",
"./src/ui/pages/settings.vue",
],
other: [
"./src/ui/pages/404.vue",
"./src/ui/pages/login.vue",
"./src/ui/pages/import.vue",
],
},
},
plugins: [
(() =>
process.env.SOURCE_MAP === "1"
? sentryRollupPlugin({
org: "twin-te",
project: "front",
include: path.resolve(__dirname, "dist"),
authToken: process.env.SENTRY_AUTH_TOKEN,
})
: null)(),
],
},
},
}));