2025-02-27 14:38:47 +08:00
|
|
|
import {defineConfig} from 'vite';
|
|
|
|
|
import vue from '@vitejs/plugin-vue';
|
|
|
|
|
import tailwindcss from 'tailwindcss';
|
|
|
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
2025-03-10 19:01:21 +08:00
|
|
|
import vueDevTools from 'vite-plugin-vue-devtools';
|
2025-02-27 14:38:47 +08:00
|
|
|
import Components from 'unplugin-vue-components/vite';
|
|
|
|
|
import {ArcoResolver} from 'unplugin-vue-components/resolvers';
|
2025-04-19 15:28:32 +08:00
|
|
|
import {vitePluginForArco} from "@arco-plugins/vite-vue";
|
2025-04-30 10:02:22 +08:00
|
|
|
import legacy from '@vitejs/plugin-legacy';
|
|
|
|
|
import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator';
|
|
|
|
|
import allObfuscatorConfig from "./obfuscatorConfig.js";
|
|
|
|
|
import {visualizer} from 'rollup-plugin-visualizer';
|
|
|
|
|
import viteCompression from 'vite-plugin-compression';
|
2025-02-27 13:46:35 +08:00
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
|
|
|
|
export default defineConfig({
|
2025-02-27 14:38:47 +08:00
|
|
|
base: './',
|
|
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
2025-03-10 19:01:21 +08:00
|
|
|
vueDevTools(),
|
2025-02-27 14:38:47 +08:00
|
|
|
AutoImport({
|
|
|
|
|
resolvers: [ArcoResolver()],
|
|
|
|
|
}),
|
|
|
|
|
Components({
|
2025-04-30 10:02:22 +08:00
|
|
|
resolvers: [ArcoResolver({
|
|
|
|
|
sideEffect: true
|
|
|
|
|
})]
|
2025-02-27 14:38:47 +08:00
|
|
|
}),
|
|
|
|
|
vitePluginForArco({
|
|
|
|
|
style: 'css'
|
2025-04-30 10:02:22 +08:00
|
|
|
}),
|
|
|
|
|
legacy({
|
|
|
|
|
targets: ["defaults", "not IE 11", 'chromeAndroid>=52, iOS>=13.1']
|
|
|
|
|
}),
|
|
|
|
|
vitePluginBundleObfuscator(allObfuscatorConfig),
|
2025-04-30 10:11:04 +08:00
|
|
|
viteCompression(),
|
2025-04-30 10:02:22 +08:00
|
|
|
visualizer({open: false}),
|
|
|
|
|
], css: {
|
2025-02-27 14:38:47 +08:00
|
|
|
postcss: {
|
2025-04-30 10:02:22 +08:00
|
|
|
plugins: [tailwindcss,]
|
2025-02-27 14:38:47 +08:00
|
|
|
}
|
2025-04-30 10:02:22 +08:00
|
|
|
}, resolve: {
|
2025-02-27 14:38:47 +08:00
|
|
|
alias: {
|
|
|
|
|
'@': '/src'
|
|
|
|
|
}
|
2025-04-30 10:02:22 +08:00
|
|
|
}, server: {
|
|
|
|
|
port: 9050, proxy: {
|
2025-04-21 10:30:45 +08:00
|
|
|
'/baseApi': {
|
2025-04-30 10:02:22 +08:00
|
|
|
target: 'http://192.168.1.105', changeOrigin: true, rewrite: (path) => path.replace(/^\/baseApi/, ''),
|
2025-04-19 15:28:32 +08:00
|
|
|
}
|
|
|
|
|
}
|
2025-02-27 14:38:47 +08:00
|
|
|
}
|
2025-02-27 13:46:35 +08:00
|
|
|
})
|