jsdf / browserify-incremental

incremental rebuild for browserify
175 stars 13 forks source link

cache file source gets really messed up for .json files #29

Closed sleungcy closed 8 years ago

sleungcy commented 8 years ago

It looks like browserify-inc is not very good at dealing with .json files. On subsequent build of the .json files, browserify-inc will always append module.exports in front of the previous source.

As seen in the below source for "/mnt/myapp/app/assets/javascripts/app/a.json": has source "module.exports=module.exports=module.exports=module.exports={b:2}\n"

This only happen if the file required contains the whole json object raw without getting set to module.exports manually.

Please see the cache file in gist https://gist.github.com/sleungcy/c8b2b27c22df334c41eb

jsdf commented 8 years ago

This should be fixed in v3.1.0