jnordberg / gif.js

JavaScript GIF encoding library

Home Page:http://jnordberg.github.io/gif.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bundling gif.js almost works...

ebrensi opened this issue · comments

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

worker = new Worker @options.workerScript

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?