Skip to content
Browse files

Make compiler and dev server work with underscore/backbone

  • Loading branch information...
1 parent 0db57b3 commit 58947aa1d5bf59c1832ab2cf44b38a196ea8b977 @marcuswestin committed May 8, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 compiler.js
  2. +1 −1 server.js
View
2 compiler.js
@@ -69,7 +69,7 @@ function compileHTMLFile(filePath, opts) {
var _compile = function(code, opts, mainModule) {
- var code = 'var __require__ = {}\n' + _compileModule(code, opts.basePath, mainModule)
+ var code = 'var __require__ = {}, require=function(){}\n' + _compileModule(code, opts.basePath, mainModule)
if (opts.minify === false) { return code } // TODO use uglifyjs' beautifier?
if (opts.max_line_length == null) {
View
2 server.js
@@ -98,7 +98,7 @@ function _handleMainModuleRequest(reqPath, req, res) {
try { var deps = util.getDependencyList(modulePath) }
catch(err) { return _sendError(res, 'in util.getDependencyList: ' + err) }
- var response = ['__require__ = {}']
+ var response = ['__require__ = {}', 'require=function(){}']
var userAgent = req.headers['user-agent'],
isMobile = userAgent.match('iPad') || userAgent.match('iPod') || userAgent.match('iPhone') || userAgent.match('Android')

0 comments on commit 58947aa

Please sign in to comment.
Something went wrong with that request. Please try again.