bodalab/vite.config.js

37 lines
742 B
JavaScript

import { defineConfig } from 'vite'
import viteImagemin from 'vite-plugin-imagemin'
export default defineConfig({
root: 'src',
build: {
outDir: '../dist',
emptyOutDir: true,
assetsDir: 'assets',
},
server: {
port: 3000,
open: true,
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
plugins: [
viteImagemin({
gifsicle: { optimizationLevel: 3 },
optipng: { optimizationLevel: 5 },
mozjpeg: { quality: 80 },
pngquant: { quality: [0.7, 0.9], speed: 4 },
svgo: {
plugins: [
{ name: 'removeViewBox', active: false },
{ name: 'removeEmptyAttrs', active: true },
],
},
}),
],
})