FileSaver.js
FileSaver.js copied to clipboard
Undefined module for AMD loaders since 2.x
Using FileSaver.js prior to the 2.x release worked fine with AMD based loaders. Now the factory method does not return saveAs
, so the AMD module is undefined.
Not sure how this would impact other loaders, but this would fix it for AMD users:
(...)
_global.saveAs = saveAs.saveAs = saveAs;
if (typeof module !== 'undefined') {
module.exports = saveAs;
}
return saveAs; // This would fix the problem with AMD based loaders
Thanks Chris