{"id":15011796,"url":"https://github.com/johansatge/standalone-preact-builder","last_synced_at":"2025-04-12T03:31:14.455Z","repository":{"id":197664005,"uuid":"690691968","full_name":"johansatge/standalone-preact-builder","owner":"johansatge","description":"⚛️ Build custom, self-contained \u0026 self-hosted Preact script in the browser","archived":false,"fork":false,"pushed_at":"2025-02-15T16:26:47.000Z","size":68,"stargazers_count":32,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T23:22:58.419Z","etag":null,"topics":["bundle","esbuild","esbuild-wasm","javascript","js","preact","preact-demos","preact-signals","preactjs","react","reactjs","signals"],"latest_commit_sha":null,"homepage":"https://standalonepreact.satge.net","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johansatge.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-12T17:18:59.000Z","updated_at":"2025-02-15T16:26:50.000Z","dependencies_parsed_at":"2024-04-12T20:32:26.158Z","dependency_job_id":"07ef6cd7-2823-40c9-b5a6-2159972568a6","html_url":"https://github.com/johansatge/standalone-preact-builder","commit_stats":{"total_commits":63,"total_committers":1,"mean_commits":63.0,"dds":0.0,"last_synced_commit":"204feb599c359341e9a81b34760a0b195e09d12c"},"previous_names":["johansatge/standalone-preact-builder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fstandalone-preact-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fstandalone-preact-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fstandalone-preact-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fstandalone-preact-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johansatge","download_url":"https://codeload.github.com/johansatge/standalone-preact-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248512573,"owners_count":21116631,"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","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":["bundle","esbuild","esbuild-wasm","javascript","js","preact","preact-demos","preact-signals","preactjs","react","reactjs","signals"],"created_at":"2024-09-24T19:41:43.612Z","updated_at":"2025-04-12T03:31:14.447Z","avatar_url":"https://github.com/johansatge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Standalone Preact Builder ⚛️\n\n[![Test](https://github.com/johansatge/standalone-preact-builder/actions/workflows/test.yml/badge.svg)](https://github.com/johansatge/standalone-preact-builder/actions)\n\n\u003e Build custom, self-contained \u0026 self-hosted Preact script in the browser\n\n---\n\n* [What is this tool](#what-is-this-tool)\n* [Usage](#usage)\n* [What is the point?](#what-is-the-point)\n* [Changelog](#changelog)\n* [License](#license)\n\n## What is this tool\n\n_Standalone Preact Builder_ generates a standalone JavaScript file that contains [Preact](https://preactjs.com) and its most popular dependencies, to be self-hosted along with the rest of a JS app.\n\nThe generator runs in the browser; no installation is needed.\n\n## Usage\n\n- Open [standalonepreact.satge.net](https://standalonepreact.satge.net)\n- Check/uncheck the needed imports\n- Choose the desired output format\n  - `ESM` will allow the script to be imported from a `\u003cscript type=\"module\"\u003e`\n  - `IIFE` will expose a `window.standalonePreact` object in the browser context, containing the requested imports\n- Download the generated script or copy it to the clipboard\n- Self-host it: it's small enough to be committed in the app's Git project, and deployed with the rest of the app\n\n## What is the point?\n\nPreact offers two major advantages compared to the original React:\n- It's lightweight\n- It offers a [no build tools route](https://preactjs.com/guide/v10/getting-started#no-build-tools-route)\n\nWhen using Preact without build tools, users are advised to rely on a CDN to import Preact into their app ([`esm.sh/preact`](https://esm.sh/preact) for instance, and a few other CDNs provide the same feature) **but**:\n- The whole Preact package is usually exposed (it's lightweight, but still)\n- Things may get complicated when other packages are needed: effects, signals, [htm](https://github.com/developit/htm/issues/229)... CDNs don't always provide a clear documentation and finding the right URL with the right module to have everything working together is cumbersome\n- What if the CDN is discontinued? Unlikely but still possible in the long term, and developers who go with no build tools usually do so for projects that are there to stay for years; how enjoyable is it to reopen a project after 5 years and finding everything working as expected, without having to update Node, npm, and various packages or build scripts?\n- What if the CDN is down? [_Unpkg CDN down?_](https://github.com/mjackson/unpkg/issues/384)\n- What if the app lives in a restricted environment? Limited network connectivity, intranet with no public internet/CDN access...\n\nThis project exists as an answer to those problems.\n\n## Changelog\n\nThis project uses [semver](http://semver.org/).\n\n| Version | Date | Notes |\n| --- | --- | --- |\n| `2.0.0` | 2025-02-15 | Add Playwright tests, update deps, make `Component` mandatory |\n| `1.5.0` | 2024-07-21 | Expose `html`, update deps, add mandatory imports |\n| `1.4.0` | 2024-07-05 | Add more defaults |\n| `1.3.0` | 2024-03-24 | Update deps, add `signals` \u0026 `useState` examples |\n| `1.2.1` | 2023-10-14 | Fix ESM example |\n| `1.2.0` | 2023-10-14 | Add format in filename |\n| `1.1.0` | 2023-10-04 | Add md5 substring in code \u0026 downloaded file to simplify self-hosting |\n| `1.0.0` | 2023-10-01 | Initial version |\n\n## License\n\nThis project is released under the [MIT License](license.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohansatge%2Fstandalone-preact-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohansatge%2Fstandalone-preact-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohansatge%2Fstandalone-preact-builder/lists"}