-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
63 lines (57 loc) · 1.65 KB
/
Copy pathvite.config.ts
File metadata and controls
63 lines (57 loc) · 1.65 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
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
import { defineConfig } from "vite";
import RailsPlugin from "vite-plugin-rails";
import ReactPlugin from "@vitejs/plugin-react";
import visualizer from "rollup-plugin-visualizer";
import { readFileSync } from "fs";
import { resolve } from "path";
import { Logger } from "sass";
export default defineConfig({
plugins: [
RailsPlugin(),
ReactPlugin(),
// visualizer(),
// sentryVitePlugin({
// authToken: process.env.SENTRY_AUTH_TOKEN,
// org: "sway-a6",
// project: "sway",
// }),
],
server: {
open: false,
// https: {
// cert: readFileSync("./config/ssl/cert.pem"),
// key: readFileSync("./config/ssl/key.pem"),
// },
watch: {
usePolling: true,
},
},
resolve: {
alias: {
"app/frontend": resolve(process.cwd(), "app", "frontend"),
},
},
// Prevent Sass warnings from being logged and cluttering terminal
css: {
preprocessorOptions: {
scss: {
logger: Logger.silent,
quietDeps: true,
},
},
},
// Prevent warnings being logged when using vite + material UI
// https://github.com/vitejs/vite/issues/15012#issuecomment-1815854072
build: {
sourcemap: true,
outDir: "build",
rollupOptions: {
onLog(level, log, handler) {
if (log.cause && (log.cause as any).message === "Can't resolve original location of error.") {
return;
}
handler(level, log);
},
},
},
});