replace React bunder based on webpack with Vite #952

This commit is contained in:
Proddy
2023-02-09 20:23:31 +01:00
parent ea8850f8bd
commit 9501f02aa2
108 changed files with 3011 additions and 15196 deletions

37
interface/vite.config.ts Normal file
View File

@@ -0,0 +1,37 @@
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 { visualizer } from 'rollup-plugin-visualizer';
import ProgmemGenerator from './progmem-generator';
export default defineConfig({
plugins: [
react({ plugins: [['@swc/plugin-styled-components', {}]] }),
viteTsconfigPaths(),
svgrPlugin(),
ProgmemGenerator({ outputPath: '../lib/framework/WWWData.h', bytesPerLine: 20 }),
visualizer({ gzipSize: true }) as PluginOption
],
// root: 'src',
base: '/',
// publicDir: "./public",
build: {
// Relative to the root
outDir: 'build',
chunkSizeWarningLimit: 1024
},
server: {
open: true,
port: 3000,
proxy: {
'/rest': 'http://localhost:3080',
'/api': {
target: 'http://localhost:3080',
changeOrigin: true,
secure: false,
ws: true
}
}
}
});