{"id":22241,"library":"rollup-plugin-svelte-types","title":"rollup-plugin-svelte-types","description":"A Rollup plugin that generates TypeScript declaration (.d.ts) files for Svelte components, extracting props and events types. Version 1.0.6 is current; no frequent releases. Key differentiator: automates type generation for Svelte components in Rollup builds, reducing manual type work.","status":"active","version":"1.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/fallaciousreasoning/rollup-plugin-svelte-types","tags":["javascript","rollup","svelte","plugin","typescript","tsx","typedefinitions"],"install":[{"cmd":"npm install rollup-plugin-svelte-types","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-svelte-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-svelte-types","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency, requires Rollup >=1.20.0.","package":"rollup","optional":false}],"imports":[{"note":"ESM import is default; CommonJS require works but may have interop issues.","wrong":"const svelteDts = require('rollup-plugin-svelte-types')","symbol":"default","correct":"import svelteDts from 'rollup-plugin-svelte-types'"},{"note":"Package exports a single default function, not named export.","wrong":"import { svelteDts } from 'rollup-plugin-svelte-types'","symbol":"svelteDts","correct":"import svelteDts from 'rollup-plugin-svelte-types'"},{"note":"Type import for TypeScript users; not a runtime value.","wrong":"import { PluginOptions } from 'rollup-plugin-svelte-types'","symbol":"PluginOptions","correct":"import type { PluginOptions } from 'rollup-plugin-svelte-types'"}],"quickstart":{"code":"import svelteDts from 'rollup-plugin-svelte-types';\nimport svelte from 'rollup-plugin-svelte';\nimport resolve from '@rollup/plugin-node-resolve';\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    dir: 'public',\n    format: 'esm'\n  },\n  plugins: [\n    svelteDts({\n      libRoot: './src',\n      declarationDir: './dist/types'\n    }),\n    svelte(),\n    resolve()\n  ]\n};","lang":"javascript","description":"Minimal Rollup config using svelteDts plugin with custom libRoot and declarationDir, alongside svelte and resolve plugins."},"warnings":[{"fix":"Ensure svelte is installed in your project.","message":"Plugin requires svelte and svelte/compiler as implicit dependencies; does not install them automatically.","severity":"gotcha","affected_versions":"*"},{"fix":"Set declarationDir explicitly to control output location.","message":"In version 1.0.0, the default declaration directory changed from './types' to './dist/types' only if libRoot is not set.","severity":"breaking","affected_versions":">=1.0.0 <1.0.1"},{"fix":"Ensure tsconfig.json is present; remove `tsconfig` and `compilerOptions` from plugin config.","message":"Options `tsconfig` and `compilerOptions` were deprecated in v1.0.0; use TypeScript project configuration instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Place a tsconfig.json in your project root or set `libRoot` to a directory with a tsconfig.","message":"Plugin may generate type errors if Svelte components have TypeScript syntax but no tsconfig covers the src directory.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install svelte --save-dev","cause":"Missing svelte package in node_modules.","error":"Error: Could not find module 'svelte/compiler'"},{"fix":"npm install rollup-plugin-svelte-types --save-dev","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'rollup-plugin-svelte-types'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}