Created
October 23, 2012 19:59
-
-
Save adorsk/3941170 to your computer and use it in GitHub Desktop.
Froth compiling, via requiring a require.js module w/ Froth configs.
This file contains 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') | |
vm = require('vm') | |
requirejs = require('requirejs') | |
BASE_URL = __dirname + '/' | |
requireConfigPath = BASE_URL + 'js/require_config.js' | |
script = vm.createScript(fs.readFileSync(requireConfigPath)) | |
sandbox = { | |
require: requirejs, | |
BASE_URL: BASE_URL, | |
console: console | |
} | |
script.runInNewContext(sandbox) | |
requirejs.config({ | |
nodeRequire: require | |
}) | |
requirejs(['froth', 'app'], (Froth, app) -> | |
Frothc = require('/home/adorsk/projects/froth.js/lib/frothc.coffee') | |
Frothc.ctx = Froth | |
#Frothc.config.bundling = false | |
Frothc.compile() | |
) | |
~ | |
~ | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment