Bundling gif.js almost works...
ebrensi opened this issue · 0 comments
ebrensi commented
I am not familiar with other bundlers, but using Parcel I can import the gif.js
CoffeScript directly from the a clone of this repo, or from the npm install.
import * as GIF from "node_modules/gif.js.optimized/src/gif.coffee"
but then there is a problem with the file path for the worker. Parcel is able to successfully bundle the worker script if the worker is instantiated with a string-literal url, but unfortunately we have
Line 107 in 92d27a0
which abstracts the worker filename by having it in
options
.
This could be fixed by changing the above line to
worker = new Worker "./gif.worker.coffee"
and taking the worker file name out of options
.
For people not using a bundler, this would mean they no longer have the option of renaming the worker and putting it in a different folder.
Is this a merge you would be willing to do?