Build an Astro site with Deno
Deno 2's Node and npm compatibility lets you scaffold and run an Astro project entirely with Deno tooling: `deno -A npm:create-astro@latest` to scaffold, `deno install --allow-scripts` for dependencies, and `deno task dev` to run package.json scripts. The walkthrough builds a small dinosaur site with an index page generated from a JSON file and a dynamic SSR route (`[dinosaur].astro`) that reads `Astro.params` and redirects to 404 for unknown entries. One caveat: the Deno language server doesn't yet support `.astro` files, so editors may show false errors.
Related posts
- Build and Ship Astro Sites with Deno and Deno Deploy
Deno mediumAdeptAstro sites can be built with the Deno runtime and hosted on Deno Deploy in two modes. Static output from `npm run build` is served via the Deno standard library file server and auto-deployed from GitHub Actions. Server-rendered apps use Astro's `output: "server"` mode with a Deno adapter, a generated `server/entry.mjs` entrypoint, and npm scripts rewritten to run Astro through `deno run -A --unstable npm:astro`. A template app shows SSR form handling in component scripts, client-side delete calls to an API route, and data persistence that can be switched to Deno KV.
- Build Apps in Deno with Frameworks such as React, Vue, Express, and more.
Deno mediumAdeptDeno 1.28's npm support lets you use npm-distributed frameworks like Express, React and Vue directly via `npm:` specifiers. You don't need package.json, node_modules or a separate install step, and Deno's built-in toolchain is available throughout. Step-by-step examples build a dinosaur API with Express. They then build the same dinosaur list/detail app in React (Vite scaffold via create-vite-extra, an Oak backend with CORS, react-router-dom) and in Vue (reactive store, Suspense, vue-router).
- Build a dinosaur runner game with Deno, pt. 1
Deno mediumAdeptPart one of a series building a browser dinosaur runner game sets up a Deno project that serves static files and deploys it. It covers `deno init`, adding the Oak framework from JSR, defining `dev` and `start` tasks in deno.json with explicit `--allow-net`/`--allow-read`/`--env-file` permissions, and a minimal Oak server that serves `public/` via `context.send`. It also adds an `/api` router with a health check endpoint, then deploys with `deno deploy` using `src/main.ts` as the entry point.
- A Whole Website in a Single JavaScript File
Deno mediumAdeptA demo multi-page website fits entirely in one JavaScript file and is server-rendered on demand at the edge with Deno. Routing uses a small `router` module built on `URLPattern`, and JSX is rendered server-side with `nanossr`, which styles via twind. Triple-slash reference comments select exactly which TypeScript libs (dom, dom.asynciterable, deno.ns) are loaded. Hosted on Deno Deploy, the site gets a perfect PageSpeed score and is served from 29 data centers over an anycast IP at no cost.
- Deno 1.34: deno compile supports npm packages
Deno mediumAdeptDeno 1.34 lets `deno compile` bundle npm packages and their dependencies into a single self-contained executable. That makes tools like vite and eslint shippable as binaries with pinned dependencies, and they tend to start faster than running from a local cache. The release also adds cross-platform glob support in deno.json, deno task and CLI flags, and TLS certificates with IP addresses via rustls. Smaller changes include a top-level `exclude` and `nodeModulesDir` in config, configurable language-server limits, a `Deno.serve()` signature change that returns a `Deno.Server`, new `createHttpClient` pool options, more Node.js polyfills, and upgrades to V8 11.5 and TypeScript 5.0.4.