GoogleChromeLabs/worker-plugin

[question] Support service workers?

Open

#7 aberto em 1 de out. de 2018

Ver no GitHub
 (3 comments) (3 reactions) (0 assignees)JavaScript (88 forks)batch import
enhancementgood first issuehelp wanted

Métricas do repositório

Stars
 (1.908 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

I know this is specific to web workers, however I think this could be adapted to work for service workers. I was looking to create a separate plugin but the code would be mostly the same.

Looks like it scans the AST for a keyword (Worker) and generates an entry for the referenced file.

// web worker
new Worker('./foo.js', { type: 'module' })

// service worker
navigator.serviceWorker.register('./foo.js', { type: 'module' })

Could it be adapted to be more generic or am I missing something specific this does for web workers?

Guia do colaborador