developit / developit/workerize-loader

Duplicate worker code inside bundle file with inline option

Aperta
#129 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.3k
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi!

When using inline option in the config, I found duplicate worker code in my bundle.
Perhaps this is because of incorrect use of `createObjectURL` and `revokeObjectURL` in the case of `inline: true` option.
I believe in line 186 👇, the argument of `URL.revokeObjectURL` should not be a string with all the worker code inside it, but it should be a product of `URL.createObjectURL` method.

https://github.com/developit/workerize-loader/blob/99d98e4f14e83cff28b9269660964d5424d865bb/src/index.js#L186

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start in src/index.js at the linked code around line 186 and inspect how createObjectURL and revokeObjectURL are used when inline is true. Reproduce an inline build, compare the generated bundle with the non-inline case, and confirm that the worker code appears only once.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, webpack
Ambito
build-system, tooling
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
52/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.