-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
42 lines (39 loc) · 1.08 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import viteTsconfigPaths from "vite-tsconfig-paths";
import svgrPlugin from "vite-plugin-svgr";
import basicSsl from "@vitejs/plugin-basic-ssl";
// https://vitejs.dev/config/
import constants from "./constants";
// basicSsl()
export default defineConfig({
plugins: [react(), viteTsconfigPaths(), svgrPlugin()],
server: {
port: 8080,
https: false,
proxy: {
"/media": {
target: constants.server_path,
changeOrigin: true,
// secure: falsebasicSsl(,
// rewrite: (path) => path.replace(/^\/m/, ""),
// ws: true,
},
},
},
build: {
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name) {
const extension = assetInfo.name.split(".").at(1);
if (extension === "css") {
return `assets/${constants.css_file_name}.css`;
} else return assetInfo.name;
}
},
entryFileNames: `assets/${constants.js_file_name}`,
},
},
},
});