deepak1556 / gulp-browserify

Bundle modules with BrowserifyJS
MIT License
195 stars 45 forks source link

Shim unusable with gulp.watch #62

Open frankdejonge opened 10 years ago

frankdejonge commented 10 years ago

When using watch the shim wrapper is added x times where x is the number of times the browserify pipe is used. Resulting into broken browserify builds.

This picture shows the output of a build (with shim).

deepak1556 commented 10 years ago

@FrenkyNet can you try it out with shim v3 as a transform and still get the same build?

frankdejonge commented 10 years ago

Because this didn't work I'm now using browserify-shim as a tranform with config in package.json. All works like expected. This lead me to believe it's something in this package. All works fine on a single run, but consecutive runs all have this buildup in shim wrappers.

frankdejonge commented 10 years ago

Are there details I can send you which help you investigating this issue?

deepak1556 commented 10 years ago

Thanks! will dig into this tonite.

frankdejonge commented 10 years ago

:+1: thanks! Would love to get that clutter out of my package.json

deepak1556 commented 10 years ago

@FrenkyNet can you paste your gulp config. I tried with both the gulp.watch module and native watch but they worked fine.

frankdejonge commented 10 years ago

@deepak1556 I've already removed it, I'll get back to you on this (soon) when I've got a repo setup which shows this problem. Might be a day or two.

frankdejonge commented 10 years ago

@deepak1556 took me a bit longer. I've setup a repository which generates the issue for me, it's the bare minimum. The repository is located at: https://github.com/FrenkyNet/gulp-browserify-bug-62

After a npm install && bower install, run gulp. This will generate two JS files in assets/js/dest. The file first.js will have the correct build, but second.js will have the double wrapper.

Hope this helps.

deepak1556 commented 10 years ago

cool thanks! , i can see the problem now. will get back soon.

darwin commented 10 years ago

@FrenkyNet please try my patch when you get to it

frankdejonge commented 10 years ago

@darwin I still get the duplicate wrappers. Though the "watch growth" has stopped. Still second in the chain and following have the wrapping issue.

frankdejonge commented 10 years ago

http://cl.ly/image/3T2p3L0U463E