compressjs
compressjs copied to clipboard
AMD module definition breaks Webpack
This isn't really an issue with the code, but it does hurt integration with Webpack. Webpack uses their own custom "version" of AMD, which injects a pseudo-object that takes over from AMD.
Since the fake AMD is not an function, this line fails:
if (typeof define !== 'function') { var define = require('amdefine')(module); }
Simply taking out this line on every single file will allow Webpack to handle this module. I already have a copy of the module with that line taken out from every file, let me know if you would be interested in merging my PR.
There's actually a module that has fixed this issue, I would submit using that rather than my fork (mine's kind of hacky)
What module fixes it?
Hey,
This still breaks in the browser using browserify. Would it be possible to fix that line? I would love to use this library.
Dénes
Use the following command to install the last commit (https://github.com/Faithlife/compressjs/commit/19652f100671e559d7731980c26cd06a7e999b8d as of Oct 18 2018) in this fork: https://github.com/Faithlife/compressjs/commits/hermit
npm install --save https://github.com/Faithlife/compressjs/archive/19652f100671e559d7731980c26cd06a7e999b8d.tar.gz
Even works for React Native Packager (the least-forgiving packager of all), so it should work for Webpack and browserify