Open darwin opened 10 years ago
Thanks, But doesnt seem to fix the problem. Any suggestions ?
Well, maybe we both speak about different problem :) This definitely fixed the issues in my case of using gulp watcher with gulp-browserify, which had config passed as a separate pre-constructed object (now I see it does not match the linked example), so maybe there are more separate bugs.
My bug was caused by you modifying opts object every time browserify is called. If I always construct config object from scratch it works, but when I pass existing object and reuse it between invocations it breaks.
Shim config gets mutated when shim transformation is called. Multiple invocations cause single file to be wrapped multiple times, which breaks the wrapping functionality and leads to very cryptic javascript errors.
This problem gets exposed for example using shims together with file watching. https://github.com/FrenkyNet/gulp-browserify-bug-62/blob/master/gulpfile.js