{"repo":"hanielu/vite-plugin-svelte-inline-component","free":true,"listed":false,"github":"https://github.com/hanielu/vite-plugin-svelte-inline-component","clone":"git clone https://github.com/hanielu/vite-plugin-svelte-inline-component.git","description":"Test leaner with inline svelte components!","language":"TypeScript","stars":12,"topics":["svelte","sveltekit","vitest","inline-svelte"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"@hvniel/vite-plugin-svelte-inline-component Write tiny Svelte components straight inside your JavaScript / TypeScript tests using tagged‑template literals. --- 📖 Table of Contents - ✨ What it does - 🔧 Installation - 🚀 Usage - vite.config.ts / vite.config.js - 🧱 Definitions Fence - 🧩 Named Exports & Snippets - 🧪 Testing Inline & Reactive Components - 🛠️ API - InlineSvelteOptions - 🧐 How it works (nutshell) - ⚠️ Caveats - 📝 License --- ✨ What it does The plugin lets you write Svelte components directly in your .ts or .js test files. It finds every template literal whose tag matches a list you choose (defaults to html and svelte ), compiles the markup with the Svelte compiler, and replaces it with an import of a virtual module that exports the compiled component. No extra files. 🔧 Installation --- 🚀 Usage vite.config.ts / vite.config.js Why conditionally enable? In a typical SvelteKit project you already compile .svelte files. Turning the plugin on just for unit tests keeps production builds untouched while giving Vitest access to inline components. --- 🧱 Definitions Fence To share code across multiple inline components in the same file, wrap your ES imports, variables, and \"global\" component definitions in a special comment block. The plugin will make everything inside this fence available to each inline component's script block. --- 🔗 Local Scoping with scope(...) Inline components defined with const X = html\\ ...\\ are not automatically visible to other inline com","default_branch":null,"files":null,"tree":[],"storefront":"/r/hanielu","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/hanielu/vite-plugin-svelte-inline-component/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}