Configuring Vite
i modify the vite config with this
import path from 'path';
// import react from '@vitejs/plugin-react';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import compression from 'vite-plugin-compression';
import imagemin from 'vite-plugin-imagemin';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
imagemin({
gifsicle: { optimizationLevel: 3 },
mozjpeg: { quality: 75 },
optipng: { optimizationLevel: 5 },
svgo: { plugins: [{ removeViewBox: false }] },
}),
compression({ algorithm: 'brotliCompress' }),
],
resolve: {
alias: {
'@app': path.resolve(dirname, './src/app'),
'@entities': path.resolve(dirname, './src/entities'),
'@features': path.resolve(dirname, './src/features'),
'@pages': path.resolve(dirname, './src/pages'),
'@shared': path.resolve(dirname, './src/shared'),
'@widgets': path.resolve(dirname, './src/widgets'),
},
},
server: {
port: Number(process.env.VITE_PORT) || 5174,
hmr: {
overlay: false,
},
},
build: {
cssMinify: true,
cssCodeSplit: true,
},
});
1 Reply
magic-amber•2w ago
Hello @ErickDev
Can you ask your questions in the #ask-any-question channel, please?
About the question, maybe these plugins are can slow up your enviorement, i dont know.
Normal Refine setup works good, I dont think is related to refine but to be sure I need full repository to debug