LiveScript
LiveScript copied to clipboard
allow string interpolation in `require!`
Because I want to use https://github.com/inxilpro/node-app-root-path like a boss
root = require 'app-root-path'
require! "#root/index": index
or simply
require! {
'app-root-path': root
"#root/index": index
}
This is currently rejected by ast.Require#compile because a string interpolation is an expression, not a literal, but it can be easily fixed.
Of course this should only work in the "interpolated": assignee format.
I could have written
root = require 'app-root-path'
index = require "#root/index"
but then I lose the nice grouping of require!.