Registry / devops / vite-plugin-manifest

vite-plugin-manifest

JSON →
library0.0.1jsnpmunverified

Vite plugin that generates an asset manifest JSON file during build, similar to webpack-manifest-plugin. Version 0.0.1 is the initial and only release. It provides hooks to customize manifest generation and allows specifying publicPath and output fileName. Minimal alternative to other manifest plugins for Vite.

npm install vite-plugin-manifest
INSTALL
IMPORT
SIG · VITE-PLUGIN-MANIFE
V
vite-plugin-manifest
devopsjavascriptv0.0.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.

default
import vitePluginManifest from 'vite-plugin-manifest'
const { vitePluginManifest } = require('vite-plugin-manifest')
Default export; CommonJS require must use .default or import()
ManifestOptions
import type { ManifestOptions } from 'vite-plugin-manifest'
import { ManifestOptions } from 'vite-plugin-manifest'
Only exported as a type; use import type for TypeScript
Plugin
import type { Plugin } from 'vite'
import { Plugin } from 'vite-plugin-manifest'
Plugin type comes from Vite, not this package

Basic setup of vite-plugin-manifest in a Vite project with custom publicPath and fileName, including optional generate callback.

// vite.config.ts import { defineConfig } from 'vite'; import vitePluginManifest from 'vite-plugin-manifest'; export default defineConfig({ plugins: [ vitePluginManifest({ publicPath: '/my-app/', fileName: 'asset-manifest.json', generate: (manifest, entries, chunks) => { // Customize manifest if needed return manifest; } }) ] });
Debug
Known issues
gotchapublicPath option is required when assets are served from a subpath; if omitted, manifest uses relative paths which may break in production.
fix
Set publicPath to your deployment subpath, e.g., '/my-app/'
affects: 0.0.1
gotchaThe plugin is very early (v0.0.1) and may have bugs or missing features; not recommended for production use without testing.
fix
Test thoroughly or consider more mature alternatives like vite-plugin-manifest-sri
affects: 0.0.1
gotchaNo TypeScript definitions for the generate callback parameters; you may need to define custom types.
fix
Define interfaces for manifest, entries, and chunks manually or use inferred types
affects: 0.0.1
gotchaOnly works during build (vite build), not in dev mode; manifest will not be generated with vite dev.
fix
Use only as part of your build step; for dev manifest, consider a custom middleware
affects: 0.0.1
Errors
Common errors & fixes
TypeError: vitePluginManifest is not a function
Using named import instead of default import in ESM or forgetting .default in CommonJS.
fix
Use default import: import vitePluginManifest from 'vite-plugin-manifest'
Cannot find module 'vite-plugin-manifest' or its corresponding type declarations.
Package may not be installed or TypeScript cannot resolve types since package has no types entry in package.json.
fix
Install with npm install vite-plugin-manifest and if using TypeScript, add a declare module 'vite-plugin-manifest' or use a .d.ts file.
Error: [vite-plugin-manifest] publicPath is required
publicPath option was not provided but it's required for correct manifest generation.
fix
Add publicPath to plugin options, e.g., publicPath: '/'
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
vite-plugin-manifest — npm install vite-plugin-manifest · libregistry