mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
add minify and use terser
This commit is contained in:
@@ -2,6 +2,7 @@ import { defineConfig, type PluginOption } from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
||||
import svgrPlugin from 'vite-plugin-svgr';
|
||||
import { ViteMinifyPlugin } from 'vite-plugin-minify';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
import ProgmemGenerator from './progmem-generator';
|
||||
|
||||
@@ -18,12 +19,30 @@ export default defineConfig(({ command, mode }) => {
|
||||
react(),
|
||||
viteTsconfigPaths(),
|
||||
svgrPlugin(),
|
||||
ViteMinifyPlugin({
|
||||
removeAttributeQuotes: true,
|
||||
minifyCSS: true,
|
||||
minifyJS: true,
|
||||
decodeEntities: true,
|
||||
removeComments: true,
|
||||
removeEmptyAttributes: true,
|
||||
removeOptionalTags: true,
|
||||
removeEmptyElements: true,
|
||||
removeScriptTypeAttributes: true,
|
||||
removeTagWhitespace: true,
|
||||
minifyURLs: true
|
||||
}),
|
||||
ProgmemGenerator({ outputPath: '../lib/framework/WWWData.h', bytesPerLine: 20 })
|
||||
],
|
||||
|
||||
build: {
|
||||
outDir: 'build',
|
||||
chunkSizeWarningLimit: 1024
|
||||
chunkSizeWarningLimit: 1024,
|
||||
sourcemap: false,
|
||||
manifest: false,
|
||||
minify: mode === 'development' ? false : 'terser'
|
||||
},
|
||||
|
||||
server: {
|
||||
open: true,
|
||||
port: 3000,
|
||||
|
||||
Reference in New Issue
Block a user