{"id":22573,"library":"vite-manifest-plugin","title":"Vite Manifest Plugin","description":"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.","status":"active","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/ThanatWongsamut/vite-manifest-plugin","tags":["javascript","vite-plugin","vite plugin","module federation","typescript"],"install":[{"cmd":"npm install vite-manifest-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add vite-manifest-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-manifest-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required as a Vite plugin.","package":"vite","optional":false}],"imports":[{"note":"ESM-only package; named export.","wrong":"const viteManifestPlugin = require('vite-manifest-plugin')","symbol":"viteManifestPlugin","correct":"import { viteManifestPlugin } from 'vite-manifest-plugin'"},{"note":"TypeScript type export for options.","wrong":"","symbol":"ViteManifestPluginOptions","correct":"import type { ViteManifestPluginOptions } from 'vite-manifest-plugin'"},{"note":"Although a default export exists, the recommended usage is the named export.","wrong":"","symbol":"default export","correct":"import viteManifestPlugin from 'vite-manifest-plugin'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { viteManifestPlugin } from 'vite-manifest-plugin';\n\nexport default defineConfig({\n  build: {\n    manifest: true,\n  },\n  plugins: [\n    viteManifestPlugin({\n      fileName: 'manifest.json',\n      publicPath: process.env.PUBLIC_PATH ?? '/static/',\n    }),\n  ],\n});","lang":"typescript","description":"Configure Vite to generate a manifest and use vite-manifest-plugin to prepend a public path to all file URLs."},"warnings":[{"fix":"Ensure build.manifest: true is set in vite.config.ts.","message":"Plugin only modifies the manifest if build.manifest is set to true in Vite config.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the same fileName value as the manifest generated by Vite (default: 'manifest.json').","message":"The fileName option must match the manifest file name Vite generates, otherwise the plugin may not find the manifest.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always include trailing slash in publicPath, e.g., '/static/'.","message":"If publicPath does not end with '/', paths may be malformed.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.1':25 'ad':13,37 'altern':58 'asset':52 'cadenc':30 'current':21 'deploy':50 'differenti':32 'feder':48,72 'file':19 'focus':34 'generat':43 'irregular':29 'javascript':65 'key':31 'manifest':2,44,61 'manifest.json':9 'manual':60 'modifi':7 'modul':47,71 'output':10 'path':16,20,39 'plugin':3,5,68,70 'post':63 'post-process':62 'prefix':17 'process':64 'public':15,38 'releas':26 'serv':54 'simpl':33 'solut':35 'stabl':22 'subdirectori':57 'typescript':73 'use':45 'version':23 'vite':1,4,12,42,67,69 'vite-gener':41 'vite-plugin':66","created_at":"2026-04-27T17:05:53.179777+00:00","updated_at":"2026-04-27T17:05:53.179777+00:00","problems":[{"fix":"Set build.manifest: true in Vite config and ensure fileName matches the generated manifest name.","cause":"The file specified in fileName does not exist, or build.manifest is not enabled.","error":"Error: [vite-manifest-plugin] Manifest file not found at path/to/manifest.json"},{"fix":"Pass an options object: viteManifestPlugin({ fileName: 'manifest.json', publicPath: '/static/' })","cause":"The plugin is called without options or with undefined options.","error":"TypeError: Cannot read properties of undefined (reading 'fileName')"},{"fix":"Run: npm install vite-manifest-plugin","cause":"Package not installed or not in node_modules.","error":"Module not found: Error: Can't resolve 'vite-manifest-plugin'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ThanatWongsamut/vite-manifest-plugin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vite-manifest-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}