Skip to content

Instantly share code, notes, and snippets.

@boristane
Last active October 29, 2024 08:57
Show Gist options
  • Select an option

  • Save boristane/d83d387e9c78e1159c511b3b79bbec30 to your computer and use it in GitHub Desktop.

Select an option

Save boristane/d83d387e9c78e1159c511b3b79bbec30 to your computer and use it in GitHub Desktop.
nitro.config.ts
import { type NitroPreset } from "nitropack";
export default (<NitroPreset>{
extends: "cloudflare",
exportConditions: ["workerd"],
output: {
dir: "{{ rootDir }}/dist",
publicDir: "{{ output.dir }}/public",
serverDir: "{{ output.dir }}/worker",
},
commands: {
preview: "npx wrangler dev",
deploy: "npx wrangler deploy",
},
wasm: {
lazy: true,
esmImport: true,
},
rollupConfig: {
output: {
entryFileNames: "index.js",
format: "esm",
exports: "named",
inlineDynamicImports: true,
},
},
experimental: {
asyncContext: true,
inlineRouteRules: true,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment