-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
45 lines (40 loc) · 1.11 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
import { defineConfig } from "vite";
// import RubyPlugin from "vite-plugin-ruby"
import RailsPlugin from "vite-plugin-rails";
import ReactPlugin from "@vitejs/plugin-react";
import { readFileSync } from "fs";
import { resolve } from "path";
export default defineConfig({
plugins: [
RailsPlugin(),
ReactPlugin(),
],
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"),
},
},
// 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);
},
},
},
});