Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:clover/require

  • Loading branch information...
commit 7e9ce2c0078e97c5187f2c52520dd0ffe1e9d887 2 parents 287d3ee + c4f1fd2
@marcuswestin authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  compiler.js
  2. +1 −1  package.json
  3. +2 −2 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  package.json
@@ -15,7 +15,7 @@
},
"author": "Marcus Westin <narcvs@gmail.com> (http://marcuswest.in)",
"dependencies": {
- "uglify-js": "1.0.3"
+ "uglify-js": "1.2.6"
},
"devDependencies": {},
"directories": {}
View
4 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')
@@ -113,7 +113,7 @@ function _handleMainModuleRequest(reqPath, req, res) {
'__require__.__scripts = []',
'__require__.__loadNext = function() {',
' var src = __require__.__scripts.shift()',
- ' var url = location.protocol + src',
+ ' var url = location.protocol+"//"+location.host + src',
' if (!src) { return }',
' document.getElementsByTagName("head")[0].appendChild(document.createElement("script")).src = url',
'}')
Please sign in to comment.
Something went wrong with that request. Please try again.