{"id":22716,"library":"vite-plugin-license","title":"vite-plugin-license","description":"Vite plugin to add license banners to bundled output. Current stable version is 0.0.2 (November 2025), released on a cadence of roughly every 7 months. It is a thin wrapper around rollup-plugin-license that resolves compatibility issues with Vite's build pipeline. Key differentiators: seamless integration with Vite's configuration and plugin system; supports customizable banner comment style and content from file or inline; includes TypeScript type definitions. Compared to using rollup-plugin-license directly, this plugin handles Vite-specific nuances such as virtual module IDs and hooks.","status":"active","version":"0.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/tasshi-me/vite-plugin-license","tags":["javascript","vite-plugin","vite","typescript","license"],"install":[{"cmd":"npm install vite-plugin-license","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-license","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-license","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Vite plugin integration; version ^7.1.12 required.","package":"vite","optional":false}],"imports":[{"note":"The default export is a function; named export does not exist.","wrong":"import { license } from 'vite-plugin-license'","symbol":"default","correct":"import license from 'vite-plugin-license'"},{"note":"Type import is needed when using TypeScript for the plugin options.","wrong":"","symbol":"LicenseOptions","correct":"import type { LicenseOptions } from 'vite-plugin-license'"},{"note":"Type import for the plugin instance type, rarely needed directly.","wrong":"","symbol":"VitePluginLicense","correct":"import type { VitePluginLicense } from 'vite-plugin-license'"}],"quickstart":{"code":"import path from 'node:path';\nimport { defineConfig } from 'vite';\nimport license from 'vite-plugin-license';\n\nexport default defineConfig({\n  plugins: [\n    license({\n      banner: {\n        commentStyle: 'regular',\n        content: {\n          file: path.join(__dirname, 'LICENSE'),\n        },\n      },\n    }),\n  ],\n});","lang":"typescript","description":"Creates a Vite config with license plugin that adds a banner from LICENCE file."},"warnings":[{"fix":"Upgrade vite to ^7.1.12 or later.","message":"Peer dependency requirement: vite ^7.1.12. This plugin will not work with older Vite versions.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Replace rollup-plugin-license with vite-plugin-license.","message":"If you previously used rollup-plugin-license directly in Vite, that approach may have issues with virtual modules; this plugin is the recommended replacement.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Use 'import license from 'vite-plugin-license''.","message":"The default import is not a named export. Using 'import { license }' will result in undefined.","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":"Run 'npm install vite-plugin-license' and ensure tsconfig includes 'moduleResolution': 'node' or 'bundler'.","cause":"TypeScript cannot resolve the module because types are not installed or package is missing.","error":"Cannot find module 'vite-plugin-license' or its corresponding type declarations."},{"fix":"Change to 'import license from 'vite-plugin-license''.","cause":"Using a named import instead of default import.","error":"TypeError: license is not a function"},{"fix":"Upgrade Vite: 'npm install vite@^7.1.12'.","cause":"Installed Vite version does not satisfy peer dependency.","error":"Error: The plugin 'vite-plugin-license' requires peer vite@^7.1.12 but you have an older version."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}