{"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,"search_vec":"'1.0.6':24 'autom':32 'build':40 'compon':17,37 'current':26 'd.ts':13 'declar':12 'differenti':31 'event':21 'extract':18 'file':14 'frequent':28 'generat':10,34 'javascript':45 'key':30 'manual':42 'plugin':3,8,48 'prop':19 'reduc':41 'releas':29 'rollup':2,7,39,46 'rollup-plugin-svelte-typ':1 'svelt':4,16,36,47 'tsx':50 'type':5,22,33,43 'typedefinit':51 'typescript':11,49 'version':23 'work':44","created_at":"2026-04-27T17:04:06.969529+00:00","updated_at":"2026-04-27T17:04:06.969529+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/fallaciousreasoning/rollup-plugin-svelte-types","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-svelte-types","openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs"],"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}}