| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig, loadEnv } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import viteImagemin from 'vite-plugin-imagemin'
- import { VitePWA } from 'vite-plugin-pwa'
- // https://vitejs.dev/config/
- export default defineConfig(({ command, mode }) => {
- process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }
- return {
- base: process.env.VITE_BASE_URL,
- server: {
- host: '0.0.0.0',
- port: 3000,
- fs: {
- strict: false
- }
- },
- plugins: [
- vue(),
- viteImagemin({
- gifsicle: {
- optimizationLevel: 7,
- interlaced: false
- },
- optipng: false,
- mozjpeg: {
- quality: 80
- },
- pngquant: {
- quality: [0.5, 0.9],
- speed: 1
- },
- svgo: {
- plugins: [
- {
- name: 'removeViewBox'
- },
- {
- name: 'removeEmptyAttrs',
- active: false
- }
- ]
- },
- webp: false
- }),
- mode === 'app'
- ? null
- : VitePWA({
- registerType: 'autoUpdate',
- manifest: {
- name: 'FirstCash',
- short_name: 'FirstCash',
- theme_color: '#161616',
- background_color: '#161616',
- display: 'fullscreen',
- icons: [
- {
- src: '/icon-192x192.png',
- sizes: '192x192',
- type: 'image/png'
- },
- {
- src: '/icon-256x256.png',
- sizes: '256x256',
- type: 'image/png'
- },
- {
- src: '/icon-384x384.png',
- sizes: '384x384',
- type: 'image/png'
- },
- {
- src: '/icon-512x512.png',
- sizes: '512x512',
- type: 'image/png'
- }
- ]
- }
- })
- ].filter(i => i != null),
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- }
- },
- css: {
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- additionalData: '@import "@/styles/common.less";'
- }
- }
- }
- }
- })
|