| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import vueDevTools from 'vite-plugin-vue-devtools'
- import AutoImport from 'unplugin-auto-import/vite'
- import Components from 'unplugin-vue-components/vite'
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
- import Icons from 'unplugin-icons/vite'
- import IconsResolver from 'unplugin-icons/resolver'
- import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
- import path from 'path'
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
- // https://vite.dev/config/
- export default defineConfig({
- plugins: [
- vue(),
- vueDevTools(),
- AutoImport({
- imports: ['vue'],
- resolvers: [
- ElementPlusResolver(),
- IconsResolver({
- prefix: 'Icon',
- }),
- ],
- eslintrc: { enabled: true },
- }),
- Components({
- resolvers: [
- ElementPlusResolver(),
- IconsResolver({
- enabledCollections: ['ep'],
- }),
- ],
- }),
- Icons({
- autoInstall: true,
- }),
- ],
- build: {
- rollupOptions: {
- output: {
- manualChunks: {
- vendor: ['vue', 'axios', 'element-plus'], // 将第三方库单独打包
- },
- },
- },
- },
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- },
- },
- server: {
- proxy: {
- // 匹配以/geoserver开头的请求,转发到GeoServer
- '/geoserver': {
- target: 'http://localhost:8080', // GeoServer的地址(端口对应你的实际配置)
- changeOrigin: true, // 开启跨域
- rewrite: (path) => path // 不需要重写路径,直接转发
- }
- }
- }
- })
- function kebabCase(text: any) {
- throw new Error('Function not implemented.')
- }
|