mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-09-13 05:34:34 +00:00
fix for formidable loading, and svg being compressed
This commit is contained in:
Generated
+10
-56
@@ -131,10 +131,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==}
|
resolution: {integrity: sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@babel/generator@7.29.7':
|
|
||||||
resolution: {integrity: sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==}
|
|
||||||
engines: {node: '>=6.9.0'}
|
|
||||||
|
|
||||||
'@babel/generator@7.29.8':
|
'@babel/generator@7.29.8':
|
||||||
resolution: {integrity: sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==}
|
resolution: {integrity: sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
@@ -181,11 +177,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==}
|
resolution: {integrity: sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@babel/parser@7.29.7':
|
|
||||||
resolution: {integrity: sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==}
|
|
||||||
engines: {node: '>=6.0.0'}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
'@babel/parser@7.29.8':
|
'@babel/parser@7.29.8':
|
||||||
resolution: {integrity: sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==}
|
resolution: {integrity: sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==}
|
||||||
engines: {node: '>=6.0.0'}
|
engines: {node: '>=6.0.0'}
|
||||||
@@ -217,18 +208,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==}
|
resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@babel/traverse@7.29.7':
|
|
||||||
resolution: {integrity: sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==}
|
|
||||||
engines: {node: '>=6.9.0'}
|
|
||||||
|
|
||||||
'@babel/traverse@7.29.8':
|
'@babel/traverse@7.29.8':
|
||||||
resolution: {integrity: sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==}
|
resolution: {integrity: sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@babel/types@7.29.7':
|
|
||||||
resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==}
|
|
||||||
engines: {node: '>=6.9.0'}
|
|
||||||
|
|
||||||
'@babel/types@7.29.8':
|
'@babel/types@7.29.8':
|
||||||
resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==}
|
resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
@@ -3042,14 +3025,14 @@ snapshots:
|
|||||||
'@babel/core@7.29.7(supports-color@10.2.2)':
|
'@babel/core@7.29.7(supports-color@10.2.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/code-frame': 7.29.7
|
'@babel/code-frame': 7.29.7
|
||||||
'@babel/generator': 7.29.7
|
'@babel/generator': 7.29.8
|
||||||
'@babel/helper-compilation-targets': 7.29.7
|
'@babel/helper-compilation-targets': 7.29.7
|
||||||
'@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)
|
'@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)
|
||||||
'@babel/helpers': 7.29.7
|
'@babel/helpers': 7.29.7
|
||||||
'@babel/parser': 7.29.7
|
'@babel/parser': 7.29.8
|
||||||
'@babel/template': 7.29.7
|
'@babel/template': 7.29.7
|
||||||
'@babel/traverse': 7.29.7(supports-color@10.2.2)
|
'@babel/traverse': 7.29.8(supports-color@10.2.2)
|
||||||
'@babel/types': 7.29.7
|
'@babel/types': 7.29.8
|
||||||
'@jridgewell/remapping': 2.3.5
|
'@jridgewell/remapping': 2.3.5
|
||||||
convert-source-map: 2.0.0
|
convert-source-map: 2.0.0
|
||||||
debug: 4.4.3(supports-color@10.2.2)
|
debug: 4.4.3(supports-color@10.2.2)
|
||||||
@@ -3059,14 +3042,6 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@babel/generator@7.29.7':
|
|
||||||
dependencies:
|
|
||||||
'@babel/parser': 7.29.7
|
|
||||||
'@babel/types': 7.29.7
|
|
||||||
'@jridgewell/gen-mapping': 0.3.13
|
|
||||||
'@jridgewell/trace-mapping': 0.3.31
|
|
||||||
jsesc: 3.1.0
|
|
||||||
|
|
||||||
'@babel/generator@7.29.8':
|
'@babel/generator@7.29.8':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/parser': 7.29.8
|
'@babel/parser': 7.29.8
|
||||||
@@ -3091,8 +3066,8 @@ snapshots:
|
|||||||
|
|
||||||
'@babel/helper-module-imports@7.29.7(supports-color@10.2.2)':
|
'@babel/helper-module-imports@7.29.7(supports-color@10.2.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/traverse': 7.29.7(supports-color@10.2.2)
|
'@babel/traverse': 7.29.8(supports-color@10.2.2)
|
||||||
'@babel/types': 7.29.7
|
'@babel/types': 7.29.8
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
@@ -3101,7 +3076,7 @@ snapshots:
|
|||||||
'@babel/core': 7.29.7(supports-color@10.2.2)
|
'@babel/core': 7.29.7(supports-color@10.2.2)
|
||||||
'@babel/helper-module-imports': 7.29.7(supports-color@10.2.2)
|
'@babel/helper-module-imports': 7.29.7(supports-color@10.2.2)
|
||||||
'@babel/helper-validator-identifier': 7.29.7
|
'@babel/helper-validator-identifier': 7.29.7
|
||||||
'@babel/traverse': 7.29.7(supports-color@10.2.2)
|
'@babel/traverse': 7.29.8(supports-color@10.2.2)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
@@ -3116,11 +3091,7 @@ snapshots:
|
|||||||
'@babel/helpers@7.29.7':
|
'@babel/helpers@7.29.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/template': 7.29.7
|
'@babel/template': 7.29.7
|
||||||
'@babel/types': 7.29.7
|
'@babel/types': 7.29.8
|
||||||
|
|
||||||
'@babel/parser@7.29.7':
|
|
||||||
dependencies:
|
|
||||||
'@babel/types': 7.29.7
|
|
||||||
|
|
||||||
'@babel/parser@7.29.8':
|
'@babel/parser@7.29.8':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -3154,20 +3125,8 @@ snapshots:
|
|||||||
'@babel/template@7.29.7':
|
'@babel/template@7.29.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/code-frame': 7.29.7
|
'@babel/code-frame': 7.29.7
|
||||||
'@babel/parser': 7.29.7
|
'@babel/parser': 7.29.8
|
||||||
'@babel/types': 7.29.7
|
'@babel/types': 7.29.8
|
||||||
|
|
||||||
'@babel/traverse@7.29.7(supports-color@10.2.2)':
|
|
||||||
dependencies:
|
|
||||||
'@babel/code-frame': 7.29.7
|
|
||||||
'@babel/generator': 7.29.7
|
|
||||||
'@babel/helper-globals': 7.29.7
|
|
||||||
'@babel/parser': 7.29.7
|
|
||||||
'@babel/template': 7.29.7
|
|
||||||
'@babel/types': 7.29.7
|
|
||||||
debug: 4.4.3(supports-color@10.2.2)
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
|
|
||||||
'@babel/traverse@7.29.8(supports-color@10.2.2)':
|
'@babel/traverse@7.29.8(supports-color@10.2.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -3181,11 +3140,6 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@babel/types@7.29.7':
|
|
||||||
dependencies:
|
|
||||||
'@babel/helper-string-parser': 7.29.7
|
|
||||||
'@babel/helper-validator-identifier': 7.29.7
|
|
||||||
|
|
||||||
'@babel/types@7.29.8':
|
'@babel/types@7.29.8':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/helper-string-parser': 7.29.7
|
'@babel/helper-string-parser': 7.29.7
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 2.4 KiB |
+21
-17
@@ -2,6 +2,7 @@ import preact from '@preact/preset-vite';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { visualizer } from 'rollup-plugin-visualizer';
|
import { visualizer } from 'rollup-plugin-visualizer';
|
||||||
|
import { pathToFileURL } from 'url';
|
||||||
import { Plugin, PluginOption, defineConfig } from 'vite';
|
import { Plugin, PluginOption, defineConfig } from 'vite';
|
||||||
import viteImagemin from 'vite-plugin-imagemin';
|
import viteImagemin from 'vite-plugin-imagemin';
|
||||||
import zlib from 'zlib';
|
import zlib from 'zlib';
|
||||||
@@ -178,24 +179,20 @@ const createProductionTerserOptions = () => ({
|
|||||||
toplevel: true
|
toplevel: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// Image optimization plugin
|
// Image optimization plugin.
|
||||||
|
// Only svgo runs here: the raster optimizers (optipng, pngquant, gifsicle,
|
||||||
|
// jpegtran, mozjpeg) are native binaries whose install scripts are blocked by
|
||||||
|
// `allowBuilds` in pnpm-workspace.yaml, so they would fail on every build.
|
||||||
|
// Raster assets are committed pre-optimized instead.
|
||||||
const imageOptimizationPlugin = {
|
const imageOptimizationPlugin = {
|
||||||
...viteImagemin({
|
...viteImagemin({
|
||||||
verbose: false,
|
verbose: false,
|
||||||
gifsicle: {
|
filter: /\.svg$/i,
|
||||||
optimizationLevel: 7,
|
gifsicle: false,
|
||||||
interlaced: false
|
jpegTran: false,
|
||||||
},
|
mozjpeg: false,
|
||||||
optipng: {
|
optipng: false,
|
||||||
optimizationLevel: 7
|
pngquant: false,
|
||||||
},
|
|
||||||
mozjpeg: {
|
|
||||||
quality: 20
|
|
||||||
},
|
|
||||||
pngquant: {
|
|
||||||
quality: [0.8, 0.9],
|
|
||||||
speed: 4
|
|
||||||
},
|
|
||||||
svgo: {
|
svgo: {
|
||||||
plugins: [
|
plugins: [
|
||||||
{ name: 'removeViewBox' },
|
{ name: 'removeViewBox' },
|
||||||
@@ -210,8 +207,15 @@ export default defineConfig(
|
|||||||
async ({ command, mode }: { command: string; mode: string }) => {
|
async ({ command, mode }: { command: string; mode: string }) => {
|
||||||
if (command === 'serve') {
|
if (command === 'serve') {
|
||||||
console.log(`Preparing for standalone build with server, mode=${mode}`);
|
console.log(`Preparing for standalone build with server, mode=${mode}`);
|
||||||
// @ts-expect-error - mock server doesn't have type declarations
|
// Imported through a computed URL so the config bundler leaves it as a real
|
||||||
const { default: mockServer } = await import('../mock-api/mockServer.js');
|
// runtime import: mock-api is a separate package with its own node_modules,
|
||||||
|
// and inlining it here would drag its dependencies into every build.
|
||||||
|
const mockServerUrl = pathToFileURL(
|
||||||
|
path.resolve(import.meta.dirname, '../mock-api/mockServer.js')
|
||||||
|
).href;
|
||||||
|
const { default: mockServer } = (await import(
|
||||||
|
/* @vite-ignore */ mockServerUrl
|
||||||
|
)) as { default: () => PluginOption };
|
||||||
return {
|
return {
|
||||||
plugins: [...createBasePlugins(true, true), mockServer()],
|
plugins: [...createBasePlugins(true, true), mockServer()],
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Reference in New Issue
Block a user