Registry / devops / vite-manifest-plugin

vite-manifest-plugin

JSON →
library1.1.1jsnpmunverified

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-plugin
INSTALL
IMPORT
SIG · VITE-MANIFEST-PLUG
V
vite-manifest-plugin
devopsjavascriptv1.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

viteManifestPlugin
import { viteManifestPlugin } from 'vite-manifest-plugin'
const viteManifestPlugin = require('vite-manifest-plugin')
ESM-only package; named export.
ViteManifestPluginOptions
import type { ViteManifestPluginOptions } from 'vite-manifest-plugin'
TypeScript type export for options.
default export
import viteManifestPlugin from 'vite-manifest-plugin'
Although a default export exists, the recommended usage is the named export.

Configure Vite to generate a manifest and use vite-manifest-plugin to prepend a public path to all file URLs.

// vite.config.ts import { defineConfig } from 'vite'; import { viteManifestPlugin } from 'vite-manifest-plugin'; export default defineConfig({ build: { manifest: true, }, plugins: [ viteManifestPlugin({ fileName: 'manifest.json', publicPath: process.env.PUBLIC_PATH ?? '/static/', }), ], });
Debug
Known issues
gotchaPlugin only modifies the manifest if build.manifest is set to true in Vite config.
fix
Ensure build.manifest: true is set in vite.config.ts.
affects: >=1.0.0
gotchaThe fileName option must match the manifest file name Vite generates, otherwise the plugin may not find the manifest.
fix
Use the same fileName value as the manifest generated by Vite (default: 'manifest.json').
affects: >=1.0.0
gotchaIf publicPath does not end with '/', paths may be malformed.
fix
Always include trailing slash in publicPath, e.g., '/static/'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: [vite-manifest-plugin] Manifest file not found at path/to/manifest.json
The file specified in fileName does not exist, or build.manifest is not enabled.
fix
Set build.manifest: true in Vite config and ensure fileName matches the generated manifest name.
TypeError: Cannot read properties of undefined (reading 'fileName')
The plugin is called without options or with undefined options.
fix
Pass an options object: viteManifestPlugin({ fileName: 'manifest.json', publicPath: '/static/' })
Module not found: Error: Can't resolve 'vite-manifest-plugin'
Package not installed or not in node_modules.
fix
Run: npm install vite-manifest-plugin
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
viterequiredPeer dependency required as a Vite plugin.
Agent activity
2 hits · last 30 days
node
2
Resources
vite-manifest-plugin — npm install vite-manifest-plugin · libregistry