12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- /*******
- * @Author: gcz saadmin@126.com
- * @Date: 2025-09-01 11:38:45
- * @LastEditors: gcz saadmin@126.com
- * @LastEditTime: 2025-09-01 13:58:23
- * @FilePath: \claudetest\vite.config.js
- * @Description:
- * @
- */
- import { defineConfig } from 'vite'
- import { resolve } from 'path'
- import vue from '@vitejs/plugin-vue'
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [vue()],
- resolve: {
- alias: {
- '@': resolve(__dirname, 'src'),
- '@assets': resolve(__dirname, 'src/assets'),
- '@components': resolve(__dirname, 'src/components'),
- '@views': resolve(__dirname, 'src/views'),
- '@pages': resolve(__dirname, 'src/pages'),
- '@router': resolve(__dirname, 'src/router'),
- '@stores': resolve(__dirname, 'src/stores'),
- '@utils': resolve(__dirname, 'src/utils'),
- '@api': resolve(__dirname, 'src/api'),
- '@styles': resolve(__dirname, 'src/styles')
- }
- },
- css: {
- preprocessorOptions: {
- scss: {
- additionalData: `@use "@/styles/variables.scss" as *;`
- }
- }
- },
- server: {
- host: '0.0.0.0',
- // port: 3000,
- open: true,
- proxy: {
- '/api': {
- target: 'http://localhost:8080',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, '')
- }
- }
- },
- build: {
- outDir: 'dist',
- assetsDir: 'static',
- rollupOptions: {
- output: {
- chunkFileNames: 'static/js/[name]-[hash].js',
- entryFileNames: 'static/js/[name]-[hash].js',
- assetFileNames: 'static/[ext]/[name]-[hash].[ext]'
- }
- }
- }
- })
|