Skip to content

Commit

Permalink
chore: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Sep 29, 2024
1 parent 7108262 commit c5ebad2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/web-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ pnpm build
pnpm preview
```

## how it works

```ts
import workerUrl from "./worker.ts?worker-env";
const worker = new Worker(workerUrl, { type: "module" });
```

## during dev

```ts
// /path-to/worker.ts?worker-env
export default "/path-to/worker.ts?worker-env-file";
```

```ts
// /path-to/worker.ts?worker-env-file
import { createFetchRunner } from "/src/lib/runner";
const runner = createFetchRunner({ root: "...", environmentName: "worker" });
runner.import("/path-to/worker.ts");
```

## during build

TODO

## tbd

- need parallel client/worker build to avoid extra client build for discovering worker references
Expand Down

0 comments on commit c5ebad2

Please sign in to comment.