104 lines
2.6 KiB
JavaScript
104 lines
2.6 KiB
JavaScript
// frontend/vite.config.js
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vuetify from 'vite-plugin-vuetify'
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vuetify({
|
|
autoImport: true,
|
|
styles: {
|
|
configFile: 'src/assets/styles/settings.scss'
|
|
}
|
|
}),
|
|
VitePWA({
|
|
registerType: 'autoUpdate',
|
|
workbox: {
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}']
|
|
},
|
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png'],
|
|
manifest: {
|
|
name: 'Enterprise Asset Management',
|
|
short_name: 'AssetManager',
|
|
description: 'Professional asset management and tracking system',
|
|
theme_color: '#1976D2',
|
|
background_color: '#ffffff',
|
|
display: 'standalone',
|
|
icons: [
|
|
{
|
|
src: 'pwa-192x192.png',
|
|
sizes: '192x192',
|
|
type: 'image/png'
|
|
},
|
|
{
|
|
src: 'pwa-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png'
|
|
}
|
|
]
|
|
}
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
'@components': fileURLToPath(new URL('./src/components', import.meta.url)),
|
|
'@views': fileURLToPath(new URL('./src/views', import.meta.url)),
|
|
'@stores': fileURLToPath(new URL('./src/stores', import.meta.url)),
|
|
'@utils': fileURLToPath(new URL('./src/utils', import.meta.url)),
|
|
'@assets': fileURLToPath(new URL('./src/assets', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
host: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8055',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
assetsDir: 'assets',
|
|
sourcemap: false,
|
|
target: 'esnext',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'vendor-vue': ['vue', 'vue-router', 'pinia'],
|
|
'vendor-ui': ['vuetify'],
|
|
'vendor-utils': ['axios', 'dayjs', 'lodash-es'],
|
|
'vendor-charts': ['chart.js', 'vue-chartjs'],
|
|
'vendor-qr': ['qrcode', 'vue-qrcode-reader'],
|
|
'vendor-pdf': ['vue-pdf-embed', 'jspdf']
|
|
}
|
|
}
|
|
}
|
|
},
|
|
optimizeDeps: {
|
|
include: [
|
|
'vue',
|
|
'vue-router',
|
|
'pinia',
|
|
'vuetify',
|
|
'axios',
|
|
'dayjs',
|
|
'qrcode',
|
|
'chart.js',
|
|
'lodash-es'
|
|
]
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@import "@/assets/styles/variables.scss";`
|
|
}
|
|
}
|
|
}
|
|
}) |