jekyll-asset-pipeline
jekyll-asset-pipeline copied to clipboard
Concat BEFORE conversion?
When working with Coffescript it is important to concat .coffee files before compilation to js. Is there a way to do this?
Just out of curiosity: Why is that important?
Because of scoping and variables definitions.
Each coffee file due compiling is wrapped in a closure, so when I have multiple .coffee files with application parts, after compiling they have no access to each other. At the moment i workaround this with passing bare=true option to compiler, bit this is not good.
And this approach breaks:
module/submodule1.coffee:
Module = Module || {}
Module.submodule1 = ...
module/submodule2.coffee:
Module = Module || {}
Module.submodule2 = ...
Because when this files compiled separately, var Module defines twice
Interesting. Thank you for explaining!