https://github.com/orgsofthq/dsbuild
📦 Build modern websites with zero added frameworks. Deno, React, JS/TS, & Markdown MDX supported.
https://github.com/orgsofthq/dsbuild
bundle deno esbuild web
Last synced: 7 months ago
JSON representation
📦 Build modern websites with zero added frameworks. Deno, React, JS/TS, & Markdown MDX supported.
- Host: GitHub
- URL: https://github.com/orgsofthq/dsbuild
- Owner: orgsofthq
- License: mit
- Created: 2023-08-01T06:35:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T21:01:01.000Z (8 months ago)
- Last Synced: 2025-02-27T18:42:28.830Z (7 months ago)
- Topics: bundle, deno, esbuild, web
- Language: TypeScript
- Homepage:
- Size: 189 KB
- Stars: 96
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Run Deno code in the browser. Fast & simple.
Discord
---
`dsbuild` is a simple, fast static site builder.
It compiles any [Deno](https://deno.land/) TypeScript (or Markdown) into a
single JavaScript file that can be run in the browser.It's a one-command, zero-configuration way to build React, Markdown, or other
JS-powered web sites entirely using Deno.**Features:**
- Supports TypeScript, MDX (Markdown), JSX, and React out of the box.
- Automatic rebuilds as you develop (`dsbuild --watch`)
- Previewing via a simple included web server (`dsbuild --serve`)
- URL imports using `https://`, `file://`, `npm:`, `jsr:`, and import maps.
- Full support for Deno syntax and modules that don't require the `Deno`
namespace or system APIs.
- Powered by [`esbuild`](https://esbuild.github.io/) and
[`esbuild_deno_loader`](https://github.com/lucacasonato/esbuild_deno_loader)
under the hood.
## Installation
1. Install the
[Deno runtime](https://deno.land/manual/getting_started/installation).2. Run the following command to install dsbuild:
```sh
deno install -frAg jsr:@orgsoft/dsbuild
```3. Ensure `$HOME/.deno/bin` is in your `PATH` environment variable.
## Usage
See [examples/](examples/) for full examples of building React, Markdown, or
other JS-powered web sites.- ### `dsbuild`
- Run this command from any directory to compile `src/app.ts` into
`public/app.js`.- ### `dsbuild --watch` (or `dsbuild -w`)
- Watches `src/` directory and rebuilds on changes.
- ### `dsbuild --watch=src/ui,src/api`
- Watches `src/ui` and `src/api` and rebuilds on changes.- ### `dsbuild --watch --serve` (or `dsbuild -ws`)
- Watch and serve `public/` on `localhost:8000`.
- ### `dsbuild --import-map import-map.json`
- Builds with import map.
- ### `dsbuild --denoconfig`
- Generates a deno.json you can use for Deno development with proper `target`
and `lib` settings for Browsers/React/JSX.- You can also run `dsbuild --denoconfig --out deno.json` to write to a
file.- ### `dsbuild --tsconfig`
- Generates a tsconfig.json you can use for Deno development with proper
`target` and `lib` settings for Browsers/React/JSX.- You can also run `dsbuild --tsconfig --out tsconfig.json` to write to a
file.- ### `dsbuild --in src/some-file.ts --out public/another-file.js`
- You can configure the `in` and `out` flags to customize the input and output
files.
- These example values are the same as the defaults when you call `dsbuild`.- ### `dsbuild --target chrome99,firefox99,safari15`
- Customize the output target, to specify browsers or a different environment.
([esbuild target docs](https://esbuild.github.io/api/#target))- ### `dsbuild --serve-only`
- Serve `public/` on `localhost:8000` without building.
- ### `DENO_ENV=development dsbuild`
- Builds without minification.
## Quick Start
Check out the `examples/` folder for a demo, after `git clone`-ing this repo and
installing `dsbuild`.Inside the folder, run `dsbuild --serve --watch`, make changes to `src/app.ts`,
and you should see the page immediately update.
## Contributions & local development
You can clone this repository to make changes.
Once you have a local copy, run `deno task install:dev` from this directory to replace your `dsbuild` installation with a local development copy.
Contributions are welcome.
## License
MIT license.