gulp-browserify icon indicating copy to clipboard operation
gulp-browserify copied to clipboard

Shim unusable with gulp.watch

Open frankdejonge opened this issue 11 years ago • 12 comments

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).

frankdejonge avatar Mar 04 '14 08:03 frankdejonge

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

deepak1556 avatar Mar 04 '14 12:03 deepak1556

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 avatar Mar 04 '14 12:03 frankdejonge

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

frankdejonge avatar Mar 04 '14 12:03 frankdejonge

Thanks! will dig into this tonite.

deepak1556 avatar Mar 04 '14 12:03 deepak1556

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

frankdejonge avatar Mar 04 '14 14:03 frankdejonge

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

deepak1556 avatar Mar 07 '14 12:03 deepak1556

@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 avatar Mar 10 '14 07:03 frankdejonge

@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.

frankdejonge avatar Mar 16 '14 20:03 frankdejonge

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

deepak1556 avatar Mar 16 '14 21:03 deepak1556

@FrenkyNet please try my patch when you get to it

darwin avatar Mar 19 '14 11:03 darwin

@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 avatar Mar 19 '14 12:03 frankdejonge

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

frankdejonge avatar Mar 19 '14 12:03 frankdejonge