import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import styleImport from 'vite-plugin-style-import'
import { resolve } from 'path'
export default defineConfig({
base: './',
plugins: [
vue(),
styleImport({
libs: [
{
libraryName: 'element-plus',
resolveStyle: (name) => {
name = name.slice(3)
return `element-plus/packages/theme-chalk/src/${name}.scss`
},
resolveComponent: (name) => {
return `element-plus/lib/${name}`
}
}
]
})
],
resolve: {
alias: {
'@': resolve(__dirname, './src')
}
},
server: {
proxy: {
'/start': {
target:'http://10.2.249.243:9991',
ws: true,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/start/, '')
},
}
},
build: {
rollupOptions: {
output: {
assetFileNames: 'css/[name].[hash].css',
chunkFileNames: 'js/[name].[hash].js',
entryFileNames: 'js/[name].[hash].js'
}
}
}
})