Vite plugin that modifies the manifest.json output by Vite, adding a public path prefix to file paths. Current stable version is 1.1.1, released on an irregular cadence. Key differentiator: simple, focused solution for adding public paths to Vite-generated manifests, useful for module federation or deployments where assets are served from a subdirectory. Alternative to manual manifest post-processing.
npm install vite-manifest-pluginVerified import paths — ran on the pinned version, not inferred.
Configure Vite to generate a manifest and use vite-manifest-plugin to prepend a public path to all file URLs.
Ensure build.manifest: true is set in vite.config.ts.
Use the same fileName value as the manifest generated by Vite (default: 'manifest.json').
Always include trailing slash in publicPath, e.g., '/static/'.
Set build.manifest: true in Vite config and ensure fileName matches the generated manifest name.
Pass an options object: viteManifestPlugin({ fileName: 'manifest.json', publicPath: '/static/' })Run: npm install vite-manifest-plugin