-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e57491
commit 019c55d
Showing
10 changed files
with
67 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VITE_ARTHAS_PROXY_IP=localhost | ||
VITE_ARTHAS_PROXY_PORT=8563 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
import { defineConfig } from "vite"; | ||
import { defineConfig, loadEnv } from "vite"; | ||
import vue from "@vitejs/plugin-vue"; | ||
import * as path from "path"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [vue({ | ||
reactivityTransform:true | ||
})], | ||
resolve: { | ||
alias: { | ||
"@": path.resolve(__dirname, "./ui/src/"), | ||
}, | ||
}, | ||
build: { | ||
emptyOutDir: true, | ||
minify: "terser", | ||
terserOptions: { | ||
compress: { | ||
//生产环境时移除console | ||
drop_console: true, | ||
drop_debugger: true, | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd(), ""); | ||
const proxyTarget =`${env.VITE_ARTHAS_PROXY_IP}:${env.VITE_ARTHAS_PROXY_PORT}`; | ||
console.log("Arthas proxy :", proxyTarget); | ||
return { | ||
plugins: [vue({ | ||
reactivityTransform: true, | ||
})], | ||
resolve: { | ||
alias: { | ||
"@": path.resolve(__dirname, "./ui/src/"), | ||
}, | ||
}, | ||
rollupOptions: { | ||
input: { | ||
main: path.resolve(__dirname, "index.html"), | ||
ui: path.resolve(__dirname, "ui/index.html"), | ||
}, | ||
output: { | ||
chunkFileNames: "static/js/[name]-[hash].js", | ||
entryFileNames: "static/js/[name]-[hash].js", | ||
assetFileNames: "static/[ext]/[name]-[hash].[ext]", | ||
build: { | ||
emptyOutDir: true, | ||
minify: "esbuild", | ||
rollupOptions: { | ||
input: { | ||
main: path.resolve(__dirname, "index.html"), | ||
ui: path.resolve(__dirname, "ui/index.html"), | ||
}, | ||
output: { | ||
chunkFileNames: "static/js/[name]-[hash].js", | ||
entryFileNames: "static/js/[name]-[hash].js", | ||
assetFileNames: "static/[ext]/[name]-[hash].[ext]", | ||
}, | ||
}, | ||
|
||
}, | ||
}, | ||
define:{ | ||
'__VUE_OPTIONS_API__':false | ||
}, | ||
base: "/", | ||
server: { | ||
proxy: { | ||
"/api": { | ||
target: "http://127.0.0.1:8563", | ||
changeOrigin: true, | ||
esbuild: { | ||
drop: ["console", "debugger"], | ||
}, | ||
define: { | ||
"__VUE_OPTIONS_API__": false, | ||
}, | ||
base: "/", | ||
server: { | ||
proxy: { | ||
"/api": { | ||
target: `http://${proxyTarget}`, | ||
changeOrigin: true, | ||
} | ||
}, | ||
}, | ||
}, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters