{"id":22240,"library":"rollup-plugin-svelte-ssr","title":"rollup-plugin-svelte-ssr","description":"Server-side rendering of a Svelte app at build-time using a Rollup plugin. Current stable version is 1.0.3, last released in June 2020. The plugin pre-renders a Svelte component with specified props during the Rollup build, outputting static HTML and CSS files. Differentiators: simple Rollup integration, supports custom output file naming, CSS/HTML preprocessing, and selective JS file emission. Ideal for generating static HTML for Svelte apps in a Rollup build pipeline. Note: This project appears to be in maintenance mode with no recent updates.","status":"maintenance","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/akaSybe/rollup-plugin-svelte-ssr","tags":["javascript","svelte","ssr","rollup-plugin"],"install":[{"cmd":"npm install rollup-plugin-svelte-ssr","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-svelte-ssr","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-svelte-ssr","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency to function as a Rollup plugin.","package":"rollup","optional":false},{"reason":"Required to compile Svelte components for SSR.","package":"svelte","optional":false}],"imports":[{"note":"Package exposes a default export as a function.","wrong":"const ssr = require('rollup-plugin-svelte-ssr')","symbol":"default","correct":"import ssr from 'rollup-plugin-svelte-ssr'"},{"note":"Named import incorrectly used; only default export exists.","wrong":"import { ssr } from 'rollup-plugin-svelte-ssr'","symbol":"ssr","correct":"import ssr from 'rollup-plugin-svelte-ssr'"},{"note":"The default export is a function, not a class. Renaming is allowed but not necessary.","wrong":"import RollupPluginSvelteSsr from 'rollup-plugin-svelte-ssr'","symbol":"RollupPluginSvelteSsr","correct":"import ssr from 'rollup-plugin-svelte-ssr'"}],"quickstart":{"code":"// rollup.config.js\nimport svelte from 'rollup-plugin-svelte';\nimport ssr from 'rollup-plugin-svelte-ssr';\n\nexport default {\n  input: 'src/App.svelte',\n  output: {\n    format: 'cjs',\n    file: 'dist/ssr.js',\n  },\n  plugins: [\n    svelte({ generate: 'ssr' }),\n    ssr({\n      fileName: 'ssr.html',\n      props: { name: 'World' },\n    }),\n  ],\n};\n// Assumes a Svelte component at src/App.svelte with export let name;","lang":"javascript","description":"Rollup config to SSR a Svelte component into a static HTML file during build."},"warnings":[{"fix":"Place the svelte plugin with generate: 'ssr' before the ssr plugin in the plugins array.","message":"The plugin expects svelte({ generate: 'ssr' }) to be used before the ssr plugin. Order matters.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using built-in SvelteKit SSR or other actively maintained solutions.","message":"This package has not been updated since June 2020. It may not support newer Svelte or Rollup versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use environment variables or build-time configuration to inject dynamic values.","message":"The props option only supports static props at build time; runtime dynamic props are not possible.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set skipEmit: true if you only need the HTML output.","message":"If skipEmit is set to false (default), the JS output file will still be emitted even though SSR HTML is generated. This may cause confusion.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Add svelte({ generate: 'ssr' }) to your Rollup config.","cause":"Missing or incorrect generate option in svelte plugin.","error":"Error: generate option must be 'dom' or 'ssr'"},{"fix":"Use 'import ssr from \"rollup-plugin-svelte-ssr\"' instead of 'import { ssr } from ...'.","cause":"Using a named import instead of default import.","error":"TypeError: ssr is not a function"},{"fix":"Use an older version of Rollup or look for an alternative plugin.","cause":"The plugin was built for Rollup 1.x/2.x and may break with Rollup 3.x.","error":"The plugin 'rollup-plugin-svelte-ssr' is not compatible with Rollup 3+"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}