forked from chobitsnerv/lite-web-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
79 lines (78 loc) · 2.41 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
70
71
72
73
74
75
76
77
78
79
import { defineConfig } from "vite";
import { visualizer } from "rollup-plugin-visualizer";
import vue from "@vitejs/plugin-vue";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), visualizer()],
server: {
host: "0.0.0.0",
port: 3000,
proxy: {
"/remoteorign": {
target:
"https://asoul1.asoul-rec.com/%E6%AD%8C%E8%88%9E%E5%88%87%E7%89%87/MP3%E7%9B%B4%E6%92%AD%E6%AD%8C%E6%9B%B2%E5%88%87%E7%89%87",
changeOrigin: true,
secure: true,
rewrite: (p) => p.replace(/^\/remoteorign/, ""),
},
"/remotetuned": {
target:
"https://asoul1.asoul-rec.com/%E6%AD%8C%E8%88%9E%E5%88%87%E7%89%87/MP3%E7%9B%B4%E6%92%AD%E6%AD%8C%E6%9B%B2%E5%88%87%E7%89%87/%E4%BF%AE%E5%A4%8D%E6%96%87%E7%89%A9",
changeOrigin: true,
secure: true,
rewrite: (p) => p.replace(/^\/remotetuned/, ""),
},
},
},
resolve: {
alias: [
{ find: "@", replacement: path.resolve(__dirname, "./src") },
{ find: "apis", replacement: path.resolve(__dirname, "./src/apis") },
{ find: "assets", replacement: path.resolve(__dirname, "./src/assets") },
{ find: "ui", replacement: path.resolve(__dirname, "./src/assets/ui") },
{
find: "components",
replacement: path.resolve(__dirname, "./src/components"),
},
{
find: "popup",
replacement: path.resolve(__dirname, "./src/components/popup"),
},
{
find: "globals",
replacement: path.resolve(__dirname, "./src/globals"),
},
{ find: "styles", replacement: path.resolve(__dirname, "./src/styles") },
{ find: "utils", replacement: path.resolve(__dirname, "./src/utils") },
],
},
define: {
BACKDOOR_WORDS: JSON.stringify("ASOULMEMORY"),
APP_VERSION: JSON.stringify("1.1"),
REMOTE_SOURCE_URL: JSON.stringify("0.1"),
MOST_N: 10,
AVAILABLE_DAYS_LIMIT: 5,
CUTTER_DISPLAY_MAX: 5,
SONGNAME_CONTAIN_VERSION: true,
SONG_NAME_SOURCE_MODE: true,
AUDIO_DURATION_IN_MS: true,
DL_CDN_ON: true,
},
build: {
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
return id
.toString()
.split("node_modules/")[1]
.split("/")[0]
.toString();
}
},
},
},
},
});