forked from rustwasm/wasm_game_of_life
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev]: Make it work in reactts-esbuild environment
- Loading branch information
Takuma Kira
committed
Apr 19, 2024
1 parent
1f10586
commit bf281a7
Showing
6 changed files
with
446 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env node | ||
import * as esbuild from 'esbuild' | ||
import wasmPlugin from './wasmPlugin.mjs' | ||
|
||
const ctx = await esbuild.context({ | ||
entryPoints: ['./src/index.jsx'], | ||
bundle: true, | ||
outfile: './public/bundle/index.js', | ||
plugins: [wasmPlugin], | ||
}) | ||
|
||
const { host, port } = await ctx.serve({ | ||
servedir: 'public', | ||
onRequest: () => { | ||
console.log('Got request') | ||
}, | ||
}) | ||
console.log(`http://${host}:${port}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.