mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
vite chunk optimizations
This commit is contained in:
@@ -52,8 +52,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@preact/compat": "^17.1.2",
|
"@preact/compat": "^17.1.2",
|
||||||
"@preact/preset-vite": "^2.7.0",
|
"@preact/preset-vite": "^2.7.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
||||||
"@typescript-eslint/parser": "^6.16.0",
|
"@typescript-eslint/parser": "^6.17.0",
|
||||||
"concurrently": "^8.2.2",
|
"concurrently": "^8.2.2",
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-config-airbnb": "^19.0.4",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ const bytesPerLine = 20;
|
|||||||
var totalSize = 0;
|
var totalSize = 0;
|
||||||
|
|
||||||
const generateWWWClass = () =>
|
const generateWWWClass = () =>
|
||||||
`typedef std::function<void(const char *, const char * contentType, const uint8_t * content, size_t len)> RouteRegistrationHandler;
|
`typedef std::function<void(const String &, const String & contentType, const uint8_t * content, size_t len)> RouteRegistrationHandler;
|
||||||
|
// Total size is ${totalSize} bytes
|
||||||
|
|
||||||
class WWWData {
|
class WWWData {
|
||||||
${indent}public:
|
${indent}public:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig, splitVendorChunkPlugin } from 'vite';
|
||||||
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
||||||
import preact from '@preact/preset-vite';
|
import preact from '@preact/preset-vite';
|
||||||
import viteImagemin from 'vite-plugin-imagemin';
|
import viteImagemin from 'vite-plugin-imagemin';
|
||||||
@@ -44,6 +44,7 @@ export default defineConfig(({ command, mode }) => {
|
|||||||
plugins: [
|
plugins: [
|
||||||
preact(),
|
preact(),
|
||||||
viteTsconfigPaths(),
|
viteTsconfigPaths(),
|
||||||
|
splitVendorChunkPlugin(),
|
||||||
{
|
{
|
||||||
...viteImagemin({
|
...viteImagemin({
|
||||||
verbose: false,
|
verbose: false,
|
||||||
@@ -112,6 +113,20 @@ export default defineConfig(({ command, mode }) => {
|
|||||||
nameCache: null,
|
nameCache: null,
|
||||||
safari10: false,
|
safari10: false,
|
||||||
toplevel: false
|
toplevel: false
|
||||||
|
},
|
||||||
|
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks(id: string) {
|
||||||
|
if (id.includes('node_modules')) {
|
||||||
|
// creating a chunk to react routes deps. Reducing the vendor chunk size
|
||||||
|
if (id.includes('react-router-dom') || id.includes('@remix-run') || id.includes('react-router')) {
|
||||||
|
return '@react-router';
|
||||||
|
}
|
||||||
|
return 'vendor';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1689,15 +1689,15 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/eslint-plugin@npm:^6.16.0":
|
"@typescript-eslint/eslint-plugin@npm:^6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/eslint-plugin@npm:6.16.0"
|
resolution: "@typescript-eslint/eslint-plugin@npm:6.17.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@eslint-community/regexpp": "npm:^4.5.1"
|
"@eslint-community/regexpp": "npm:^4.5.1"
|
||||||
"@typescript-eslint/scope-manager": "npm:6.16.0"
|
"@typescript-eslint/scope-manager": "npm:6.17.0"
|
||||||
"@typescript-eslint/type-utils": "npm:6.16.0"
|
"@typescript-eslint/type-utils": "npm:6.17.0"
|
||||||
"@typescript-eslint/utils": "npm:6.16.0"
|
"@typescript-eslint/utils": "npm:6.17.0"
|
||||||
"@typescript-eslint/visitor-keys": "npm:6.16.0"
|
"@typescript-eslint/visitor-keys": "npm:6.17.0"
|
||||||
debug: "npm:^4.3.4"
|
debug: "npm:^4.3.4"
|
||||||
graphemer: "npm:^1.4.0"
|
graphemer: "npm:^1.4.0"
|
||||||
ignore: "npm:^5.2.4"
|
ignore: "npm:^5.2.4"
|
||||||
@@ -1710,44 +1710,44 @@ __metadata:
|
|||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
checksum: 4bedce948ac3c20492a59813ee5d4f1f2306310857864dfaac2736f6c38e18785002c36844fd64c9fbdf3059fc390b29412be105fd7a118177f1eeeb1eb533f7
|
checksum: f2a5774e9cc03e491a5a488501e5622c7eebd766f5a4fc2c30642864a3b89b0807946bde33a678f326ba7032f3f6a51aa0bf9c2d10adc823804fc9fb47db55a6
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/parser@npm:^6.16.0":
|
"@typescript-eslint/parser@npm:^6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/parser@npm:6.16.0"
|
resolution: "@typescript-eslint/parser@npm:6.17.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/scope-manager": "npm:6.16.0"
|
"@typescript-eslint/scope-manager": "npm:6.17.0"
|
||||||
"@typescript-eslint/types": "npm:6.16.0"
|
"@typescript-eslint/types": "npm:6.17.0"
|
||||||
"@typescript-eslint/typescript-estree": "npm:6.16.0"
|
"@typescript-eslint/typescript-estree": "npm:6.17.0"
|
||||||
"@typescript-eslint/visitor-keys": "npm:6.16.0"
|
"@typescript-eslint/visitor-keys": "npm:6.17.0"
|
||||||
debug: "npm:^4.3.4"
|
debug: "npm:^4.3.4"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^7.0.0 || ^8.0.0
|
eslint: ^7.0.0 || ^8.0.0
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
checksum: 3d941ce345dc2ce29957e2110957662873d514b094b8939923c3281d858c11cd1f9058db862644afe14f68d087770f39a0a1f9e523a2013ed5d2fdf3421b34d0
|
checksum: 2ed0ed4a5b30e953430ce3279df3655af09fa1caed2abf11804d239717daefc32a22864f6620ef57bb9c684c74a99a13241384fea5096e961385e3678fc2e920
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/scope-manager@npm:6.16.0":
|
"@typescript-eslint/scope-manager@npm:6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/scope-manager@npm:6.16.0"
|
resolution: "@typescript-eslint/scope-manager@npm:6.17.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types": "npm:6.16.0"
|
"@typescript-eslint/types": "npm:6.17.0"
|
||||||
"@typescript-eslint/visitor-keys": "npm:6.16.0"
|
"@typescript-eslint/visitor-keys": "npm:6.17.0"
|
||||||
checksum: 3360aae4b85f5c31d20ad48d771cc09a6f8f6b1811b00d94f06e55b5a09c610ac75631b1c4edecb3bec682d41351b87e7d14d42bee84aa032064d0e13463035b
|
checksum: fe09c628553c9336e6a36d32c1d34e78ebd20aa02130a6bf535329621ba5a98aaac171f607bc6e4d17b3478c42e7de6476376636897ce3f227c754eb99acd07e
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/type-utils@npm:6.16.0":
|
"@typescript-eslint/type-utils@npm:6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/type-utils@npm:6.16.0"
|
resolution: "@typescript-eslint/type-utils@npm:6.17.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/typescript-estree": "npm:6.16.0"
|
"@typescript-eslint/typescript-estree": "npm:6.17.0"
|
||||||
"@typescript-eslint/utils": "npm:6.16.0"
|
"@typescript-eslint/utils": "npm:6.17.0"
|
||||||
debug: "npm:^4.3.4"
|
debug: "npm:^4.3.4"
|
||||||
ts-api-utils: "npm:^1.0.1"
|
ts-api-utils: "npm:^1.0.1"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -1755,23 +1755,23 @@ __metadata:
|
|||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
checksum: 5964b87a87252bed278a248eb568902babd7c34defd3af8c3df371926d96aec716f33f1dc14bde170e93f73ed1b0af6e591e647853d0f33f378e2c7b3b73fc5b
|
checksum: dc7938429193acfda61b7282197ec046039e2c4da41cdcddf4daaf300d10229e4e23bb0fcf0503b19c0b99a874849c8a9f5bb35ce106260f56a14106d2b41d8c
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/types@npm:6.16.0":
|
"@typescript-eslint/types@npm:6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/types@npm:6.16.0"
|
resolution: "@typescript-eslint/types@npm:6.17.0"
|
||||||
checksum: 236ca318c2440c95068e5d4d147e2bfed62447775e18695e21c8ca04a341a74d01c37ed2b417629b7bf2fb91ad4fd5e2a6570215d16fc24dd1507ce6973b4e22
|
checksum: 87ab1b5a3270ab34b917c22a2fb90a9ad7d9f3b19d73a337bc9efbe65f924da13482c97e8ccbe3bd3d081aa96039eeff50de41c1da2a2128066429b931cdb21d
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/typescript-estree@npm:6.16.0":
|
"@typescript-eslint/typescript-estree@npm:6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/typescript-estree@npm:6.16.0"
|
resolution: "@typescript-eslint/typescript-estree@npm:6.17.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types": "npm:6.16.0"
|
"@typescript-eslint/types": "npm:6.17.0"
|
||||||
"@typescript-eslint/visitor-keys": "npm:6.16.0"
|
"@typescript-eslint/visitor-keys": "npm:6.17.0"
|
||||||
debug: "npm:^4.3.4"
|
debug: "npm:^4.3.4"
|
||||||
globby: "npm:^11.1.0"
|
globby: "npm:^11.1.0"
|
||||||
is-glob: "npm:^4.0.3"
|
is-glob: "npm:^4.0.3"
|
||||||
@@ -1781,34 +1781,34 @@ __metadata:
|
|||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
checksum: 8e1ef03ecabaf3791b11240a51217836dbb74850e458258db77ac5eab5508cd9c63fb671924993d1e7654718c0c857c3550d51ecba0845fe489d143bb858e1b1
|
checksum: 1671b0d2f2fdf07074fb1e2524d61935cec173bd8db6e482cc5b2dcc77aed3ffa831396736ffa0ee2fdbddd8585ae9ca8d6c97bcaea1385b23907a1ec0508f83
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/utils@npm:6.16.0":
|
"@typescript-eslint/utils@npm:6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/utils@npm:6.16.0"
|
resolution: "@typescript-eslint/utils@npm:6.17.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@eslint-community/eslint-utils": "npm:^4.4.0"
|
"@eslint-community/eslint-utils": "npm:^4.4.0"
|
||||||
"@types/json-schema": "npm:^7.0.12"
|
"@types/json-schema": "npm:^7.0.12"
|
||||||
"@types/semver": "npm:^7.5.0"
|
"@types/semver": "npm:^7.5.0"
|
||||||
"@typescript-eslint/scope-manager": "npm:6.16.0"
|
"@typescript-eslint/scope-manager": "npm:6.17.0"
|
||||||
"@typescript-eslint/types": "npm:6.16.0"
|
"@typescript-eslint/types": "npm:6.17.0"
|
||||||
"@typescript-eslint/typescript-estree": "npm:6.16.0"
|
"@typescript-eslint/typescript-estree": "npm:6.17.0"
|
||||||
semver: "npm:^7.5.4"
|
semver: "npm:^7.5.4"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^7.0.0 || ^8.0.0
|
eslint: ^7.0.0 || ^8.0.0
|
||||||
checksum: 84dd02f7c8e47fae699cc222da5cbea08b28c6e1cc7827860430bc86c2a17ee3f86e198a4356902b95930f85785aa662266ea9c476f69bf80c6a5f648e55f9f4
|
checksum: 37c63afcf66124bf84808699997953b8c84a378aa2c490a771b611d82cdac8499c58fac8eeb8378528e97660b59563d99297bfec4b982cd68760b0ffe54aa714
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/visitor-keys@npm:6.16.0":
|
"@typescript-eslint/visitor-keys@npm:6.17.0":
|
||||||
version: 6.16.0
|
version: 6.17.0
|
||||||
resolution: "@typescript-eslint/visitor-keys@npm:6.16.0"
|
resolution: "@typescript-eslint/visitor-keys@npm:6.17.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/types": "npm:6.16.0"
|
"@typescript-eslint/types": "npm:6.17.0"
|
||||||
eslint-visitor-keys: "npm:^3.4.1"
|
eslint-visitor-keys: "npm:^3.4.1"
|
||||||
checksum: 19e559f14ea0092585a374b8c5f1aca9b6b271fc23909d9857de9cf71a1e1d3abc0afd237e9c02d7a5fbdfe8e3be7853cf9fedf40a6f16bac3495cb7f4e67982
|
checksum: a2aed0e1437fdab8858ab9c7c8e355f8b72a5fa4b0adc54f28b8a2bbc29d4bb93214968ee940f83d013d0a4b83d00cd4eeeb05fb4c2c7d0ead324c6793f7d6d4
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -1838,8 +1838,8 @@ __metadata:
|
|||||||
"@types/react": "npm:^18.2.46"
|
"@types/react": "npm:^18.2.46"
|
||||||
"@types/react-dom": "npm:^18.2.18"
|
"@types/react-dom": "npm:^18.2.18"
|
||||||
"@types/react-router-dom": "npm:^5.3.3"
|
"@types/react-router-dom": "npm:^5.3.3"
|
||||||
"@typescript-eslint/eslint-plugin": "npm:^6.16.0"
|
"@typescript-eslint/eslint-plugin": "npm:^6.17.0"
|
||||||
"@typescript-eslint/parser": "npm:^6.16.0"
|
"@typescript-eslint/parser": "npm:^6.17.0"
|
||||||
alova: "npm:^2.16.2"
|
alova: "npm:^2.16.2"
|
||||||
async-validator: "npm:^4.2.5"
|
async-validator: "npm:^4.2.5"
|
||||||
concurrently: "npm:^8.2.2"
|
concurrently: "npm:^8.2.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user