{"id":13632086,"url":"https://github.com/small-tech/site-vite-svelte","last_synced_at":"2026-06-03T23:31:27.142Z","repository":{"id":117560746,"uuid":"353456851","full_name":"small-tech/site-vite-svelte","owner":"small-tech","description":"Site.js + Vite + Svelte starter template","archived":false,"fork":false,"pushed_at":"2021-04-02T12:01:44.000Z","size":34,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T03:50:04.836Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/small-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-31T18:43:15.000Z","updated_at":"2023-05-25T11:12:33.000Z","dependencies_parsed_at":"2024-01-22T01:09:58.732Z","dependency_job_id":"fdc1a452-3f30-4e6d-95cc-884e23813259","html_url":"https://github.com/small-tech/site-vite-svelte","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/small-tech/site-vite-svelte","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fsite-vite-svelte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fsite-vite-svelte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fsite-vite-svelte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fsite-vite-svelte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/small-tech","download_url":"https://codeload.github.com/small-tech/site-vite-svelte/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/small-tech%2Fsite-vite-svelte/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285704833,"owners_count":27217837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:02:50.877Z","updated_at":"2025-11-21T23:02:50.726Z","avatar_url":"https://github.com/small-tech.png","language":"Svelte","funding_links":[],"categories":["Svelte"],"sub_categories":[],"readme":"# Site.js + Vite + Svelte\n\nThis template will help get you started developing with [Vite](https://vitejs.dev) and [Svelte](https://svelte.dev) in [Site.js](https://sitejs.org).\n\nIt’s based on the [Vite + Svelte template](https://github.com/vitejs/vite/tree/main/packages/create-app/template-svelte).\n\n## Why?\n\nBy using [Site.js](https://sitejs.org) you can extend your static Vite + Svelte clients using dynamic [DotJS](https://sitejs.org/#dynamic-sites) routes, [WebSockets](https://sitejs.org/#websockets), [a JavaScript database](https://sitejs.org/#database), etc., and easily deploy to your own server using the [built-in sync feature](https://github.com/small-tech/site.js#sync).\n\n## Install\n\n1. ### __Either:__\n\n    _Download the template:_\n\n    ```shell\n    npm init using small-tech/site-vite-svelte my-project\n    ```\n\n    This will download this template using [create-using](https://github.com/aral/create-using/tree/create-using#readme) into a directory called `my-project`.\n\n    ### __Or__:\n\n    _Use the template on GitHub:_\n\n    Click the green “Use this template” button on [the GitHub page](https://github.com/small-tech/site-vite-svelte) to create your own repository using this template.\n\n    ### __Or__:\n\n    _Do it old-skool:_\n\n    Just fork this repository and clone it as you normally do using `git`.\n\n2. ### __Install dependencies.__\n\n    ```shell\n    cd my-project\n    npm i\n    ```\n\n## Use\n\n### Dev (Site.js + Vite)\n\n```shell\nnpm run dev\n```\n\nThis will run the `dev.sh` script that:\n\n1. Will build the latest Vite source using `vite build`\n2. Start the Vite dev server in the background\n3. Start Site.js.\n\nOnce the servers are running, you will have:\n\n  - __Vite:__ Running at `https://localhost:444` with HMR.\n  - __Site.js:__ Running at `https://localhost` with all features (including serving dynamic [DotJS](https://sitejs.org/#dynamic-sites) routes and [WebSockets](https://sitejs.org/#websockets), etc.)\n\nNote that the Vite build is _not_ automatically updated when hitting the Site.js endpoint. To update it, run the build command (see below).\n\nAlso note that the `dev.sh` script will only run on Linux-esque systems. If you’re on Windows, please run the commands listed above manually. Pull requests are welcome for a `dev-windows` task that runs a PowerShell script to do the same thing.\n\n### Vite only\n\n```shell\nnpm run vite\n```\n\nThis will run the Vite dev server _only_ (not Site.js) at `https://localhost:444`.\n\n### Build\n\n```shell\nnpm run build\n```\n\nThis will build the Vite source into the `.generated` folder that is served by Site.js.\n\n### Serve\n\n```shell\nnpm run serve\n```\n\nThis will:\n\n1. Build the latest Vite source using `vite build`\n2. Serve the site using Site.js.\n\nHit `https://localhost` to view and test your site.\n\n_Note that the Vite dev server will not be run. If that’s what you want, please run the dev task._\n\n## Inherited characteristics from the Vite + Svelte template\n\n### Recommended IDE Setup\n\n[VSCodium](https://vscodium.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).\n\n### Technical considerations\n\n**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**\n\nSetting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.\n\n**Why include `.vscode/extensions.json`?**\n\nOther templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.\n\n**Why enable `checkJs` in the JS template?**\n\nIt is likely that most cases of changing variable types in runtime are likely to be accidental, rather than deliberate. This provides advanced typechecking out of the box. Should you like to take advantage of the dynamically-typed nature of JavaScript, it is trivial to change the configuration.\n\n**Why is HMR not preserving my local component state?**\n\nHMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behaviour. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).\n\nIf you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.\n\n```js\n// store.js\n// An extremely simple external store\nimport { writable } from 'svelte/store'\nexport default writable(0)\n```\n\n## Like this? Fund us!\n\n[Small Technology Foundation](https://small-tech.org) is a tiny, independent not-for-profit.\n\nWe exist in part thanks to patronage by people like you. If you share [our vision](https://small-tech.org/about/#small-technology) and want to support our work, please [become a patron or donate to us](https://small-tech.org/fund-us) today and help us continue to exist.\n\n## Copyright\n\nCopyright \u0026copy; 2021-present [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org).\n\n## License\n\n[AGPL v3.0](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmall-tech%2Fsite-vite-svelte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmall-tech%2Fsite-vite-svelte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmall-tech%2Fsite-vite-svelte/lists"}