file gallery_bigThumbs.js • Make the changes you want in gallery_bigThumbs.js • load both gallery.js and gallery_bigThumbs.js to memory • In runtime use the appropriate module according to feature toggle state
var gallery = multiquire('./gallery.js'); using multirequire() loads ‘gallery.js’ to memory loads both ‘gallery.js’ and ‘gallery_bigThumbs.js’ to memory
get messy if we’re not using abstraction layers to manage our branching • CommonJS already gives us a very good start point • Using multiquire we can create variation files and use the relevant file on runtime