Skip to content
Advertisement

Tag: vite

React.js builds with Vite does not include service-worker.ts

I am using Vite to build an SPA with React (typescript), and I am trying to register a service-worker. I am registering the script as type module, and service-worker.ts sits at src/web-worker/service-worker.ts. There is also a tsconfig.json at src/web-worker Everything works in Dev, but when it’s built, src/web-worker/service-worker.ts is not replaced with anything equivalent. Any suggestions? index.html src/web-worker/service-worker.ts src/web-worker/tsconfig.json Answer

Advertisement