{"id":22737,"library":"vite-plugin-manifest","title":"vite-plugin-manifest","description":"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.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/xiefucai/vite-plugin-manifest.git","tags":["javascript","vite","plugin","typescript"],"install":[{"cmd":"npm install vite-plugin-manifest","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-manifest","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-manifest","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export; CommonJS require must use .default or import()","wrong":"const { vitePluginManifest } = require('vite-plugin-manifest')","symbol":"default","correct":"import vitePluginManifest from 'vite-plugin-manifest'"},{"note":"Only exported as a type; use import type for TypeScript","wrong":"import { ManifestOptions } from 'vite-plugin-manifest'","symbol":"ManifestOptions","correct":"import type { ManifestOptions } from 'vite-plugin-manifest'"},{"note":"Plugin type comes from Vite, not this package","wrong":"import { Plugin } from 'vite-plugin-manifest'","symbol":"Plugin","correct":"import type { Plugin } from 'vite'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport vitePluginManifest from 'vite-plugin-manifest';\n\nexport default defineConfig({\n  plugins: [\n    vitePluginManifest({\n      publicPath: '/my-app/',\n      fileName: 'asset-manifest.json',\n      generate: (manifest, entries, chunks) => {\n        // Customize manifest if needed\n        return manifest;\n      }\n    })\n  ]\n});","lang":"typescript","description":"Basic setup of vite-plugin-manifest in a Vite project with custom publicPath and fileName, including optional generate callback."},"warnings":[{"fix":"Set publicPath to your deployment subpath, e.g., '/my-app/'","message":"publicPath option is required when assets are served from a subpath; if omitted, manifest uses relative paths which may break in production.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Test thoroughly or consider more mature alternatives like vite-plugin-manifest-sri","message":"The plugin is very early (v0.0.1) and may have bugs or missing features; not recommended for production use without testing.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Define interfaces for manifest, entries, and chunks manually or use inferred types","message":"No TypeScript definitions for the generate callback parameters; you may need to define custom types.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Use only as part of your build step; for dev manifest, consider a custom middleware","message":"Only works during build (vite build), not in dev mode; manifest will not be generated with vite dev.","severity":"gotcha","affected_versions":"0.0.1"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use default import: import vitePluginManifest from 'vite-plugin-manifest'","cause":"Using named import instead of default import in ESM or forgetting .default in CommonJS.","error":"TypeError: vitePluginManifest is not a function"},{"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.","cause":"Package may not be installed or TypeScript cannot resolve types since package has no types entry in package.json.","error":"Cannot find module 'vite-plugin-manifest' or its corresponding type declarations."},{"fix":"Add publicPath to plugin options, e.g., publicPath: '/'","cause":"publicPath option was not provided but it's required for correct manifest generation.","error":"Error: [vite-plugin-manifest] publicPath is required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}