Created
June 28, 2012 17:02
-
-
Save jrburke/3012544 to your computer and use it in GitHub Desktop.
override print for r.js optimizer
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
var requirejs = require('requirejs'), | |
foo = require('foo'); | |
requirejs.define('node/print', [], function () { | |
function print(msg) { | |
//Do whatever you want with the msg here. | |
//If you use node dependencies, can just require | |
//them outside of this closure. | |
foo(msg); | |
} | |
return print; | |
}); | |
//Do the build. | |
requirejs.optimize({ | |
//Usually requirejs.optimize() runs in "silent mode" | |
//when called in this way. Use logLevel to get the | |
//normal output out. | |
logLevel: 0 | |
}, function () { | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment