mirror of https://github.com/alibaba/arthas.git
parent
3e5749127c
commit
019c55d5cf
@ -0,0 +1,2 @@
|
||||
VITE_ARTHAS_PROXY_IP=localhost
|
||||
VITE_ARTHAS_PROXY_PORT=8563
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
@ -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,
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue