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