vite-plugin-app-loading (v0.5.4) is a Vite plugin that injects a custom loading animation into the HTML entry point during development and production builds, which automatically hides when the app mounts. It uses a virtual import `virtual:app-loading` to expose a `loadingFadeOut()` function for manual dismissal. The plugin supports custom HTML/CSS loading animations via a configurable path. It requires Vite ^6.0.0, ^7.0.0, or ^8.0.0 as a peer dependency. TypeScript types are shipped via `vite-plugin-app-loading/client`. Updated regularly with dependency bumps and build tool changes (e.g., tsup replaced by tsdown in v0.4.0).
npm install vite-plugin-app-loadingVerified import paths — ran on the pinned version, not inferred.
Shows minimal setup: import the plugin and add it to the Vite config. Also demonstrates calling loadingFadeOut from virtual module.
Uninstall old package: `npm rm vite-plugin-vue-app-loading` and install new: `npm i vite-plugin-app-loading -D`. Update import path.
Use `import { loadingFadeOut } from 'virtual:app-loading'` exactly.Upgrade to Vite 6, 7, or 8. For earlier Vite versions, pin to vite-plugin-app-loading@0.4.x.
Pass relative path from project root (e.g., `AppLoading('src/loading.html')`) or resolve absolutely using `path.resolve`.Add `/// <reference types="vite-plugin-app-loading/client" />` in a .d.ts file or add `"vite-plugin-app-loading/client"` to compilerOptions.types in tsconfig.json.
Add `"vite-plugin-app-loading/client"` to compilerOptions.types in tsconfig.json, or add `/// <reference types="vite-plugin-app-loading/client" />` in a .d.ts file.
Use `import AppLoading from 'vite-plugin-app-loading'` (no braces).
Run `npm i vite-plugin-app-loading -D` and ensure a compatible Vite version (6, 7, or 8) is installed.
Verify the path (e.g., `AppLoading('src/loading.html')`) and ensure the file exists at that relative path from project root.