Created
August 18, 2010 09:37
-
-
Save StanAngeloff/534178 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'b' | |
this_ is_ file_ a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this_ is_ from_ b_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ coffee -p -r ./require.coffee a.coffee | |
(function() { | |
this_(is_(from_(b_))); this_(is_(file_(a))); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
CoffeeScript.on 'success', (task) -> | |
return unless task.output | |
task.output = task.output.replace /[ \t]*require\(['"]([^'"]+).\);[\r\n]*/g, (line, file) -> | |
CoffeeScript.compile fs.readFileSync(fs.realpathSync("./#{file}.coffee"), 'utf8'), noWrap: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment