{"_id":"@cherrywind/vite-plugin-lit-ssg","_rev":"3-6a08c470f44b920a96e2c768ad78324c","name":"@cherrywind/vite-plugin-lit-ssg","dist-tags":{"latest":"0.0.1-alpha.3"},"versions":{"0.0.1-alpha.1":{"name":"@cherrywind/vite-plugin-lit-ssg","version":"0.0.1-alpha.1","keywords":["vite","lit","ssg","static-site-generation","web-components"],"license":"MIT","_id":"@cherrywind/vite-plugin-lit-ssg@0.0.1-alpha.1","maintainers":[{"name":"qaqspringbreeze","email":"rzc307853639@gmail.com"}],"homepage":"https://github.com/susanforme/vite-lit-ssg#readme","bugs":{"url":"https://github.com/susanforme/vite-lit-ssg/issues"},"bin":{"vite-lit-ssg":"dist/cli.cjs"},"dist":{"shasum":"016c00292a4d52cf11dd2a87d6708ec2ec5099e2","tarball":"https://registry.npmjs.org/@cherrywind/vite-plugin-lit-ssg/-/vite-plugin-lit-ssg-0.0.1-alpha.1.tgz","fileCount":81,"integrity":"sha512-CnUM9vWocjoqDr8NlnqyG24cl8DN3vzHmXB70JhHIW9RG6sOA/lIqkcCfgDiKnACwQQYbgfNqlO8yrOilwhRvQ==","signatures":[{"sig":"MEYCIQD7Eg9gq35K93kmHZTjcBxTVtl/O5pj7YDw4wCgln+39AIhAJsjFQNgVX3uEKAdcw1QRbuJPJnymZnPjs5GPlihUMWM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":791684},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.cjs","default":"./dist/index.cjs","require":"./dist/index.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","default":"./dist/browser.js"},"./package.json":"./package.json"},"gitHead":"578c3f9e7227f91c494577e99d14fae57574f26d","scripts":{"dev":"rspack build --config rspack.config.mjs --watch","lint":"eslint src","build":"rspack build --config rspack.config.mjs --env kind=node-library --env clean=true && rspack build --config rspack.config.mjs --env kind=cli && rspack build --config rspack.config.mjs --env kind=browser && tsc -p tsconfig.build.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"qaqspringbreeze","email":"rzc307853639@gmail.com"},"repository":{"url":"git+https://github.com/susanforme/vite-lit-ssg.git","type":"git","directory":"packages/vite-plugin-lit-ssg"},"_npmVersion":"10.9.3","description":"Vite plugin for Lit static site generation","directories":{},"_nodeVersion":"22.19.0","dependencies":{"tinyglobby":"^0.2.16","typescript":"^5.7.0","magic-string":"^0.30.17","@lit-labs/ssr":"^4.0.0","@lit-labs/ssr-client":"^1.1.7","@literals/html-css-minifier":"^4.0.1","@webcomponents/template-shadowroot":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"lit":"^3.3.2","vite":"^6.0.0","@rspack/cli":"^1.7.11","@types/node":"^22.0.0","@rspack/core":"^1.7.11"},"peerDependencies":{"lit":"^3.0.0","vite":"^5.0.0 || ^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-lit-ssg_0.0.1-alpha.1_1776869718069_0.41009575161838074","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.2":{"name":"@cherrywind/vite-plugin-lit-ssg","version":"0.0.1-alpha.2","keywords":["vite","lit","ssg","static-site-generation","web-components"],"license":"MIT","_id":"@cherrywind/vite-plugin-lit-ssg@0.0.1-alpha.2","maintainers":[{"name":"qaqspringbreeze","email":"rzc307853639@gmail.com"}],"homepage":"https://github.com/susanforme/vite-lit-ssg#readme","bugs":{"url":"https://github.com/susanforme/vite-lit-ssg/issues"},"bin":{"vite-lit-ssg":"dist/cli.cjs"},"dist":{"shasum":"bb7c33ce97cfab1155a9099654e6298924e670c8","tarball":"https://registry.npmjs.org/@cherrywind/vite-plugin-lit-ssg/-/vite-plugin-lit-ssg-0.0.1-alpha.2.tgz","fileCount":82,"integrity":"sha512-w/RtynaUfDMJHUP8Xgf5QXiQeY3yHGzXn/H2pYdn4KglEMA5wxXUZKlCcl31pBR5Fd0hkNCc1PbAj0ICXqQx8g==","signatures":[{"sig":"MEUCIHLrz9XoeF07TSDLpWVuQ13Q1+Ids/AGccpu/LD0VTMMAiEAlZtHq9q99J+aqSS0SzfkFtSoJTIonvIpaWsXRKPo598=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cherrywind%2fvite-plugin-lit-ssg@0.0.1-alpha.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":793539},"main":"./dist/index.cjs","type":"module","_from":"file:cherrywind-vite-plugin-lit-ssg-0.0.1-alpha.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.cjs","default":"./dist/index.cjs","require":"./dist/index.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","default":"./dist/browser.js"},"./package.json":"./package.json"},"scripts":{"dev":"rspack build --config rspack.config.mjs --watch","lint":"eslint src","build":"rspack build --config rspack.config.mjs --env kind=node-library --env clean=true && rspack build --config rspack.config.mjs --env kind=cli && rspack build --config rspack.config.mjs --env kind=browser && tsc -p tsconfig.build.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:79bf23e4-9eee-46db-995a-715654e012db"}},"_resolved":"/tmp/3d66959f7db554c9c78ad4d957be813d/cherrywind-vite-plugin-lit-ssg-0.0.1-alpha.2.tgz","_integrity":"sha512-w/RtynaUfDMJHUP8Xgf5QXiQeY3yHGzXn/H2pYdn4KglEMA5wxXUZKlCcl31pBR5Fd0hkNCc1PbAj0ICXqQx8g==","repository":{"url":"git+https://github.com/susanforme/vite-lit-ssg.git","type":"git","directory":"packages/vite-plugin-lit-ssg"},"_npmVersion":"11.11.0","description":"Vite plugin for Lit static site generation","directories":{},"_nodeVersion":"24.14.1","dependencies":{"tinyglobby":"^0.2.16","typescript":"^5.7.0","magic-string":"^0.30.17","@lit-labs/ssr":"^4.0.0","@lit-labs/ssr-client":"^1.1.7","@literals/html-css-minifier":"^4.0.1","@webcomponents/template-shadowroot":"^0.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"lit":"^3.3.2","vite":"^6.0.0","@rspack/cli":"^1.7.11","@types/node":"^22.0.0","@rspack/core":"^1.7.11"},"peerDependencies":{"lit":"^3.0.0","vite":"^5.0.0 || ^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-lit-ssg_0.0.1-alpha.2_1776908333223_0.5775953278863526","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.3":{"name":"@cherrywind/vite-plugin-lit-ssg","version":"0.0.1-alpha.3","description":"Vite plugin for Lit static site generation","type":"module","main":"./dist/index.cjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.cjs","require":"./dist/index.cjs","default":"./dist/index.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","default":"./dist/browser.js"},"./package.json":"./package.json"},"bin":{"vite-lit-ssg":"dist/cli.cjs"},"dependencies":{"@lit-labs/ssr":"^4.0.0","@lit-labs/ssr-client":"^1.1.7","@literals/html-css-minifier":"^4.0.1","@webcomponents/template-shadowroot":"^0.2.1","magic-string":"^0.30.17","tinyglobby":"^0.2.16","typescript":"^5.7.0"},"devDependencies":{"@rspack/cli":"^1.7.11","@rspack/core":"^1.7.11","@types/node":"^22.0.0","lit":"^3.3.2","vite":"^6.0.0"},"peerDependencies":{"lit":"^3.0.0","vite":"^5.0.0 || ^6.0.0"},"engines":{"node":">=18.0.0"},"keywords":["vite","lit","ssg","static-site-generation","web-components"],"repository":{"type":"git","url":"git+https://github.com/susanforme/vite-lit-ssg.git","directory":"packages/vite-plugin-lit-ssg"},"publishConfig":{"access":"public"},"license":"MIT","scripts":{"build":"rspack build --config rspack.config.mjs --env kind=node-library --env clean=true && rspack build --config rspack.config.mjs --env kind=cli && rspack build --config rspack.config.mjs --env kind=browser && tsc -p tsconfig.build.json","dev":"rspack build --config rspack.config.mjs --watch","typecheck":"tsc --noEmit","lint":"eslint src"},"_id":"@cherrywind/vite-plugin-lit-ssg@0.0.1-alpha.3","bugs":{"url":"https://github.com/susanforme/vite-lit-ssg/issues"},"homepage":"https://github.com/susanforme/vite-lit-ssg#readme","_integrity":"sha512-DpCp/d9CWmxePktuiq+Rj9VO9fDwQxhLOFmf0X0pD5It0SiCAzJPw4VQhe6D4IHSQebqNNCFaUjbBFExTnA/hw==","_resolved":"/tmp/1645de5e0e2297d11ba1413383eed955/cherrywind-vite-plugin-lit-ssg-0.0.1-alpha.3.tgz","_from":"file:cherrywind-vite-plugin-lit-ssg-0.0.1-alpha.3.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-DpCp/d9CWmxePktuiq+Rj9VO9fDwQxhLOFmf0X0pD5It0SiCAzJPw4VQhe6D4IHSQebqNNCFaUjbBFExTnA/hw==","shasum":"3173a3ce4fe6248dea3deb40aba65aa7e0cf25a4","tarball":"https://registry.npmjs.org/@cherrywind/vite-plugin-lit-ssg/-/vite-plugin-lit-ssg-0.0.1-alpha.3.tgz","fileCount":84,"unpackedSize":802495,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cherrywind%2fvite-plugin-lit-ssg@0.0.1-alpha.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAWtj1uOl6gPXks4gfqed5nNn5NuySdHPpttCeAgHqzxAiBnbOO3uGd7EwC2/b9t0dbk3zkPJmdyJeUKxYVC8y2rTA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:79bf23e4-9eee-46db-995a-715654e012db"}},"directories":{},"maintainers":[{"name":"qaqspringbreeze","email":"rzc307853639@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vite-plugin-lit-ssg_0.0.1-alpha.3_1776909290782_0.8823745394553728"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-22T14:55:17.953Z","modified":"2026-04-23T01:54:51.275Z","0.0.1-alpha.1":"2026-04-22T14:55:18.263Z","0.0.1-alpha.2":"2026-04-23T01:38:53.427Z","0.0.1-alpha.3":"2026-04-23T01:54:51.016Z"},"bugs":{"url":"https://github.com/susanforme/vite-lit-ssg/issues"},"license":"MIT","homepage":"https://github.com/susanforme/vite-lit-ssg#readme","keywords":["vite","lit","ssg","static-site-generation","web-components"],"repository":{"type":"git","url":"git+https://github.com/susanforme/vite-lit-ssg.git","directory":"packages/vite-plugin-lit-ssg"},"description":"Vite plugin for Lit static site generation","maintainers":[{"name":"qaqspringbreeze","email":"rzc307853639@gmail.com"}],"readme":"# vite-plugin-lit-ssg\n\n**English** | [简体中文](./README-zh.md)\n\n> [!WARNING]\n> This package is in **alpha** (`0.0.1-alpha.1`). APIs and output format may change before the first stable release. Not recommended for production use yet.\n\nBuild-time static site generation for [Lit](https://lit.dev) web components. Drop your `LitElement` page files in `src/pages/`, run one command, and get a fully pre-rendered static site ready to deploy anywhere — no server required.\n\n## Why vite-plugin-lit-ssg\n\n- **Zero configuration** — routes are auto-discovered from `src/pages/`. No route manifest to maintain.\n- **True SSR prerendering** — pages render to real HTML at build time via [Lit SSR](https://lit.dev/docs/ssr/overview/), so users get content immediately without waiting for JS.\n- **Full Lit compatibility** — Shadow DOM, `@customElement`, decorators, and `LitElement` lifecycle all work as expected. No special wrappers or adapters needed.\n- **Single command** — `vite-lit-ssg build` replaces your normal `vite build`. It handles the client bundle, the SSR pass, and the final HTML in one step.\n- **Deploy anywhere** — output is plain HTML files in `dist/`. Netlify, GitHub Pages, S3, Vercel — any static host works.\n\n## Install\n\n```bash\nnpm install vite-plugin-lit-ssg lit vite\n```\n\n`vite` and `lit` are peer dependencies. `@lit-labs/ssr` is pulled in automatically.\n\n## Quick Start\n\n### 1. Add the plugin\n\n```ts\n// vite.config.ts\nimport { defineConfig } from 'vite'\nimport { litSSG } from 'vite-plugin-lit-ssg'\n\nexport default defineConfig({\n  plugins: [litSSG()],\n})\n```\n\n### 2. Add the build script\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"vite-lit-ssg build\"\n  }\n}\n```\n\n### 3. Create a page\n\n```ts\n// src/pages/index.ts\nimport { LitElement, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { defineLitRoute } from 'vite-plugin-lit-ssg/browser'\n\n@customElement('home-page')\nexport class HomePage extends LitElement {\n  render() {\n    return html`<h1>Hello, world</h1>`\n  }\n}\n\nexport default defineLitRoute({\n  component: HomePage,\n  title: 'Home',\n})\n```\n\n### 4. Build\n\n```bash\nnpm run build\n```\n\nOutput in `dist/` is ready to deploy:\n\n```\ndist/\n  index.html\n  about/\n    index.html\n  assets/\n    [hash].js\n```\n\n## Page Routes\n\nFiles in `src/pages/` map directly to routes:\n\n| File | Route |\n|---|---|\n| `src/pages/index.ts` | `/` |\n| `src/pages/about.ts` | `/about` |\n| `src/pages/blog/index.ts` | `/blog` |\n| `src/pages/blog/post.ts` | `/blog/post` |\n\nSupported extensions: `.ts`, `.tsx`, `.js`, `.jsx`.\n\nUse the `ignore` option to skip non-route folders (e.g. `components/`, `layouts/`) that live inside `src/pages/`.\n\n## Page Metadata\n\nEach page exports a `defineLitRoute()` call to set its HTML metadata:\n\n```ts\nimport { defineLitRoute } from 'vite-plugin-lit-ssg/browser'\n\nexport default defineLitRoute({\n  component: MyPage,\n  title: 'My Page',\n  lang: 'en',\n  meta: [{ name: 'description', content: 'My page description' }],\n  head: ['<link rel=\"canonical\" href=\"https://example.com/\">'],\n  htmlAttrs: { 'data-theme': 'light' },\n  bodyAttrs: { class: 'page-home' },\n})\n```\n\n## Plugin Options\n\n### Page Mode (default)\n\n```ts\nlitSSG({\n  pagesDir?: string                                        // default: 'src/pages'\n  ignore?: string | string[] | ((relPath: string) => boolean)\n  commonStyles?: Array<{ file: string }>                   // shared CSS prepended into each component\n  injectPolyfill?: boolean                                 // default: true\n})\n```\n\n### Single-Component Mode\n\nInstead of generating a full site, produce a single embeddable SSR fragment — useful for embedding a prerendered Lit component into an existing page or CMS.\n\n```ts\nlitSSG({\n  mode: 'single-component',\n  entry: 'src/my-widget.ts',\n  exportName?: string,                   // default: 'default'\n  wrapperTag?: string | (() => string),  // default: 'lit-ssg-root'\n  preload?: 'inherit' | 'none' | 'entry-only',\n  commonStyles?: Array<{ file: string }>,\n  injectPolyfill?: boolean,              // default: false\n  dsdPendingStyle?: boolean,\n})\n```\n\nOutput is an embeddable HTML fragment (no `<!doctype>`, no `<html>` shell) written to `dist/index.html`.\n\n## What This Is Not\n\n- Not an online SSR server — output is static files only\n- Not a partial hydration / islands framework\n- Not a dynamic routing system — no `[slug].ts` parameterized routes yet\n- Not a nested layout system — no `layout.ts` convention yet\n\n## License\n\nMIT\n","readmeFilename":"README.md"}