I am currently working on a TypeScript Next.js project:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
I have the requirement to incorporate a Web worker into this project. I understand that the worker is initiated using
new Worker("worker.js")
.
Can someone guide me on how to generate the .js
file from worker.ts
in the correct manner?
I could directly use tsc
, but I am uncertain if it's the appropriate approach, how to integrate it properly into the package.json
scripts, and whether it involves referencing tsconfig.json
.