Skip to content

fictitious/typescript-worker-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Every time I use workers in a TypeScript project, I feel like I'm fighting it. This is me trying to figure out the right way to do it. I have not yet succeeded.

To try to build:

npm i
npm run build

I think the answer is somewhere in Project References, but I haven't figured it out yet.

Issues

  • In the root tsconfig.json, I have to tell it to ignore files in dist, else it drags them into the project. Surely I shouldn't have to do this?
  • It doesn't like that I'm trying to reference types in dedicated-worker from main.
  • It complains about clients in src/service-worker/index.ts, as it isn't using Service​Worker​Global​Scope as the global.
  • It complains about event.request in src/service-worker/index.ts, as it isn't using the service worker types for addEventListener.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%