jekyll-asset-pipeline icon indicating copy to clipboard operation
jekyll-asset-pipeline copied to clipboard

Concat BEFORE conversion?

Open terion-name opened this issue 11 years ago • 3 comments

When working with Coffescript it is important to concat .coffee files before compilation to js. Is there a way to do this?

terion-name avatar Jun 12 '14 08:06 terion-name

Just out of curiosity: Why is that important?

cs avatar Jun 15 '14 08:06 cs

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

terion-name avatar Jun 15 '14 09:06 terion-name

Interesting. Thank you for explaining!

cs avatar Jun 15 '14 10:06 cs