Installing service and web workers #944
Unanswered
craigbilner
asked this question in
Q&A
Replies: 1 comment
-
You can use the bundle functionality like this on startup or using task start const command = new Deno.Command("deno", {
args: [
"bundle",
"--platform=browser", // in case of web worker
"worker.ts", // input
"-o",
"worker.js" // output
],
});
const { code, stdout, stderr } = await command.output();
if(code !== 0) {
console.warn(new TextDecoder().decode(stderr))
} else {
console.info(new TextDecoder().decode(stdout));
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What's the best practice for installing workers?
For my webworker the only way I could get it to work was to create in a
useEffect
hook using a path to root and serving a.js
file fromstatic
. Ideally I'd like to use.ts
but the auto createdContent-Type
is incorrect.Beta Was this translation helpful? Give feedback.
All reactions