Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD module definition breaks Webpack #19

Open
saltyJeff opened this issue Mar 23, 2018 · 4 comments
Open

AMD module definition breaks Webpack #19

saltyJeff opened this issue Mar 23, 2018 · 4 comments

Comments

@saltyJeff
Copy link

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.

@saltyJeff
Copy link
Author

There's actually a module that has fixed this issue, I would submit using that rather than my fork (mine's kind of hacky)

webpack compressjs

@myrddraall
Copy link

What module fixes it?

@pinting
Copy link

pinting commented Jul 22, 2018

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

@EdmondChuiHW
Copy link

EdmondChuiHW commented Oct 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants