Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concat BEFORE conversion? #45

Open
terion-name opened this issue Jun 12, 2014 · 3 comments
Open

Concat BEFORE conversion? #45

terion-name opened this issue Jun 12, 2014 · 3 comments

Comments

@terion-name
Copy link

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

@cs
Copy link
Contributor

cs commented Jun 15, 2014

Just out of curiosity: Why is that important?

@terion-name
Copy link
Author

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

@cs
Copy link
Contributor

cs commented Jun 15, 2014

Interesting. Thank you for explaining!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants