Deno
Rakkas projects can be built to run on Deno and can be deployed to Deno Deploy. First, you should install the suitable HatTip adapter:
npm install -S @hattip/adapter-deno
Then you should set the adapter
option of Rakkas Vite plugin to "deno"
:
import { defineConfig } from "vite";
import rakkas from "rakkasjs/vite-plugin";
export default defineConfig({
plugins: [
rakkas({
adapter: "deno",
}),
],
});
After building with rakkas build
, you can run with deno run --allow-read --allow-net --allow-env dist/deno/index.js
or deploy with cd dist/deno && deployctl deploy --token <TOKEN> --project=<PROJECT> index.js
(replace <TOKEN>
and <PROJECT>
with your own).
Deno-specific APIs
During development, Rakkas applications always run on Node.js regardless of the adapter
setting. As such, Deno APIs will not be available during development. We're looking into ways of polyfilling these APIs for development.