Closed gabrielecirulli closed 9 years ago
It may depends on how you actually build the bundle. I have a lot of issues while trying some things to play well together. There were just configuration misconceptions.
For example, if you require
some module in a browserify pipeline manually, it won't be shimmed automatically, unless you explicitly add a transform
with the browserify-shim module to the pipeline.
If you provide your build scripts (gulp/grunt) or the command you run, it may help the community to figure out the problem.
We need a reproducible example to look at this
Sorry for the lack of response. I ended up removing that library from my code, and haven't had problems with browserify-shim since. I think we can close this.
No worries. Doesn't sound like a b-shim issue to me. Cheers!
I have a browserify setup where I can shim bower modules (also using shimbro).
I've installed
headroom.js
through bower and added the following fields topackage.json
:For some reason, no matter what I do, the line
won't be added to the bottom of the file, no matter what.
To be clear, looking in the bundled result the file is present in full (because I required it in my application code), but the module export line is not there.
Also, at some point while I was trying to fix it, the line was there but requiring the file was returning an empty object. Even placing
console.log
calls in the source file printingwindow.Headroom
were showing the expected object, but it wasn't being exported at all.I can do without Headroom for the time being but this problem is quite unsettling because I couldn't figure out what was happening and more importantly why.
Am I doing something wrong?