What’s the best way to programatically build a .js file ?
I have recently been in the need to add some data from the data/ folder into a myfile.js JavaScript file. So I though, easy, I just need to add the .erb extension and it will first be evaluated by that template language. That’s not the case, instead middleman drops the .js extension and produces a myfile.html instead.
EDIT: Just found that Sprockets in Rails supports that: http://guides.rubyonrails.org/asset_pipeline.html#javascript-coffeescript-and-erb
EDIT2: Tried with middleman 3.1.6 and 3.2.0