perf: improve dev server startup (#128)

This commit is contained in:
Joaquín Sánchez 2023-03-22 13:56:36 +01:00 committed by GitHub
parent 8025bd240e
commit 108a8c50db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 36 deletions

View File

@ -62,7 +62,7 @@
"vite": "^4.2.0",
"vite-plugin-pages": "^0.29.0",
"vite-plugin-purge-icons": "^0.9.2",
"vite-plugin-pwa": "^0.14.4",
"vite-plugin-pwa": "^0.14.5",
"vue-tsc": "^1.2.0"
},
"pnpm": {

49
pnpm-lock.yaml generated
View File

@ -43,7 +43,7 @@ importers:
vite: ^4.2.0
vite-plugin-pages: ^0.29.0
vite-plugin-purge-icons: ^0.9.2
vite-plugin-pwa: ^0.14.4
vite-plugin-pwa: ^0.14.5
vue: 3.2.47
vue-chemistry: ^0.2.2
vue-router: 4.1.6
@ -85,7 +85,7 @@ importers:
vite: 4.2.0
vite-plugin-pages: 0.29.0_vite@4.2.0
vite-plugin-purge-icons: 0.9.2_vite@4.2.0
vite-plugin-pwa: 0.14.4_vite@4.2.0
vite-plugin-pwa: 0.14.5_vite@4.2.0
vue-tsc: 1.2.0_typescript@5.0.2
electron:
@ -269,7 +269,7 @@ packages:
convert-source-map: 1.8.0
debug: 4.3.4
gensync: 1.0.0-beta.2
json5: 2.2.1
json5: 2.2.3
semver: 6.3.0
transitivePeerDependencies:
- supports-color
@ -1885,7 +1885,7 @@ packages:
rollup: 2.79.1
dev: true
/@rollup/plugin-replace/5.0.1_rollup@3.7.3:
/@rollup/plugin-replace/5.0.1_rollup@3.19.1:
resolution: {integrity: sha512-Z3MfsJ4CK17BfGrZgvrcp/l6WXoKb0kokULO+zt/7bmcyayokDaQ2K3eDJcRLCTAlp5FPI4/gz9MHAsosz4Rag==}
engines: {node: '>=14.0.0'}
peerDependencies:
@ -1894,9 +1894,9 @@ packages:
rollup:
optional: true
dependencies:
'@rollup/pluginutils': 5.0.2_rollup@3.7.3
'@rollup/pluginutils': 5.0.2_rollup@3.19.1
magic-string: 0.26.7
rollup: 3.7.3
rollup: 3.19.1
dev: true
/@rollup/pluginutils/3.1.0_rollup@2.79.1:
@ -1925,7 +1925,7 @@ packages:
picomatch: 2.3.1
dev: true
/@rollup/pluginutils/5.0.2_rollup@3.7.3:
/@rollup/pluginutils/5.0.2_rollup@3.19.1:
resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
engines: {node: '>=14.0.0'}
peerDependencies:
@ -1937,7 +1937,7 @@ packages:
'@types/estree': 1.0.0
estree-walker: 2.0.2
picomatch: 2.3.1
rollup: 3.7.3
rollup: 3.19.1
dev: true
/@sindresorhus/is/4.6.0:
@ -1949,7 +1949,7 @@ packages:
resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==}
dependencies:
ejs: 3.1.8
json5: 2.2.1
json5: 2.2.3
magic-string: 0.25.9
string.prototype.matchall: 4.0.7
dev: true
@ -4768,7 +4768,7 @@ packages:
/for-each/0.3.3:
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
dependencies:
is-callable: 1.2.4
is-callable: 1.2.7
dev: true
/forever-agent/0.6.1:
@ -5338,11 +5338,6 @@ packages:
builtin-modules: 3.3.0
dev: true
/is-callable/1.2.4:
resolution: {integrity: sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==}
engines: {node: '>= 0.4'}
dev: true
/is-callable/1.2.7:
resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}
engines: {node: '>= 0.4'}
@ -5646,12 +5641,6 @@ packages:
minimist: 1.2.6
dev: true
/json5/2.2.1:
resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==}
engines: {node: '>=6'}
hasBin: true
dev: true
/json5/2.2.3:
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
engines: {node: '>=6'}
@ -6766,14 +6755,6 @@ packages:
fsevents: 2.3.2
dev: true
/rollup/3.7.3:
resolution: {integrity: sha512-7e68MQbAWCX6mI4/0lG1WHd+NdNAlVamg0Zkd+8LZ/oXojligdGnCNyHlzXqXCZObyjs5FRc3AH0b17iJESGIQ==}
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
fsevents: 2.3.2
dev: true
/run-parallel/1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
dependencies:
@ -7761,7 +7742,7 @@ packages:
dev: true
/verror/1.10.0:
resolution: {integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=}
resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==}
engines: {'0': node >=0.6.0}
dependencies:
assert-plus: 1.0.0
@ -7834,16 +7815,16 @@ packages:
- supports-color
dev: true
/vite-plugin-pwa/0.14.4_vite@4.2.0:
resolution: {integrity: sha512-M7Ct0so8OlouMkTWgXnl8W1xU95glITSKIe7qswZf1tniAstO2idElGCnsrTJ5NPNSx1XqfTCOUj8j94S6FD7Q==}
/vite-plugin-pwa/0.14.5_vite@4.2.0:
resolution: {integrity: sha512-LH3VCtoWx0scfim8Ph+daVl45uVRyWzXn3C3GUq92uWUui1p8eh+DjTQ23Pvb7SJ0SJtxZ99LCpOLCkFkaxokg==}
peerDependencies:
vite: ^3.1.0 || ^4.0.0
dependencies:
'@rollup/plugin-replace': 5.0.1_rollup@3.7.3
'@rollup/plugin-replace': 5.0.1_rollup@3.19.1
debug: 4.3.4
fast-glob: 3.2.12
pretty-bytes: 6.0.0
rollup: 3.7.3
rollup: 3.19.1
vite: 4.2.0
workbox-build: 6.5.4
workbox-window: 6.5.4

View File

@ -80,7 +80,12 @@ export default defineConfig(({ mode }) => {
},
],
},
includeAssets: fg.sync('**/*.*', { cwd: join(process.cwd(), 'public'), onlyFiles: true }),
integration: {
configureOptions(viteConfig, options) {
if (viteConfig.command === 'build')
options.includeAssets = fg.sync('**/*.*', { cwd: join(process.cwd(), 'public'), onlyFiles: true })
},
},
}),
UnoCSS(),
],