BabylonJS / Extensions

Extensions for Babylon.js
175 stars 155 forks source link

Import GIFExporter with webpack #182

Open westonsoftware opened 4 years ago

westonsoftware commented 4 years ago

Hi, @antpowell, thanks for gifexporter, I’d love to be able to save one of my babylonjs scenes to an animated gif.

I would like to … import GIFExporter from 'babylonjs-gifexporter' However, I get an error from my webpack build about ‘gif.creator.service.js’ cannot be loaded because it uses new Worker() to require the file.

 warning  in ./node_modules/babylonjs-gifexporter/lib/js/gif.exporter.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Anyone have a similar issue or know a workaround? I found a webpack package called ‘worker-plugin’ that seems like it should help but it doesn’t.

antpowell commented 4 years ago

Sorry for the late response, I am literally just getting back from a deployment lol🤦🏿‍♂️. I will check this out to try and see what's happening. Give me a bit, gotta readjust my mind back into engineering 😅😅.

deltakosh commented 4 years ago

Welcome back @antpowell :D