Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have CoffeeScript output a line as raw javascript?

Is there a way to tell CoffeeScript to just ignore a certain line and output it as is?

I want this line to be included in the resulting javascript

#import './blah/blah'

But CoffeeScript is compiling it as a comment so it ends up as

//import './blah/blah'

I need it to not do that because the script is being used for Apple's UIAutomation Instrument to drive iPhone UI. UIAutomation recognizes special #import statements but not if they are getting turned into javascript comments.

like image 246
Christian Schlensker Avatar asked Feb 20 '12 08:02

Christian Schlensker


1 Answers

Enclose the statement with backicks (`)

`#import './blah/blah'`

You can use any JavaScript code that way.

like image 93
jupp0r Avatar answered Sep 19 '22 01:09

jupp0r