Menu

Post image 1
Post image 2
Post image 3
Post image 4
1 / 4
0

Vite Cold Start White Screen? A Plugin Shows Resource Loading on Page

DEV Community·dev-zuo·23 days ago
#4gPwHrVX
Reading 0:00
15s threshold

TL;DR Background and Motivation In daily Vue app development, as the project become more and more complex and the number of components grows, the white screen time of the Vite dev server gradually lengthens, especially during the first load. Usually, we need to open Chrome DevTools and go to the Nework tab to see the loading progress. But some times, we don't want to open DevTools. Is there a way to show the loading progress of Vite dev server resources directly on the page? So I wrote a plugin to resolve this problem. Usage Install vite-plugin-white-screen-progress npm install vite-plugin-white-screen-progress@latest --save-dev --save-exact Enter fullscreen mode Exit fullscreen mode Edit vite.config.js, the plugin is enabled only in the dev server(vite dev)and ignored during vite build // vite.config.js import devServerWhiteScreenProgress from ' vite-plugin-white-screen-progress ' export default { // ...…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More