Skip to content

Commit

Permalink
Make compiler and dev server work with underscore/backbone
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswestin committed May 8, 2012
1 parent 0db57b3 commit 58947aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 58947aa

Please sign in to comment.