thlorenz / proxyquireify

browserify >= v2 version of proxyquire. Mocks out browserify's require to allow stubbing out dependencies while testing.
MIT License
152 stars 24 forks source link

Fix browserify 'pack' pipeline replacement #46

Closed pavlin99th closed 8 years ago

pavlin99th commented 8 years ago

Instead of replacing the 'pack' pipeline (and losing the label), this fix replaces the browser-pack stream in 'pack' sub-pipeline. This leaves the label and allows for later bfy.pipeline.get('pack') calls. One example of such call happens in watchify 3.6.1, which without this fix fails with proxyquire-universal plugin (https://github.com/substack/watchify/commit/b23c9c9f88c228b8ad26f86e49007da1edb1c287?diff=unified).

bendrucker commented 8 years ago

Nice catch! Got a test case in (a9d7d7c) that confirms the fix! :tada: