Comparing version 1.0.25 to 1.0.26
{ | ||
"name": "hrt", | ||
"version": "1.0.25", | ||
"version": "1.0.26", | ||
"description": "HTTP Rewrite Tool", | ||
@@ -5,0 +5,0 @@ "author": "Longhao Luo <lhluo@tudou.com>", |
@@ -150,6 +150,10 @@ var Fs = require('fs'); | ||
if (!/src(\/[^\/]+)+\/(lib|lite|loader)\.js$/.test(newPath) && /src(\/[^\/]+)+\/.+\.js$/.test(newPath)) { | ||
var str = Util.readFileSync(path, 'utf-8'); | ||
str = fixModule(path, str); | ||
str = replaceTemplate(path, str); | ||
return callback('application/javascript', str); | ||
if(Fs.existsSync(path)){ | ||
var str = Util.readFileSync(path, 'utf-8'); | ||
str = fixModule(path, str); | ||
str = replaceTemplate(path, str); | ||
return callback('application/javascript', str); | ||
}else{ | ||
return console.error('Not find File: '+ path) | ||
} | ||
} | ||
@@ -156,0 +160,0 @@ |
@@ -151,6 +151,10 @@ var Fs = require('fs'); | ||
if (!/src\/js\/(lib|lite|loader)\.js$/.test(newPath) && /src\/js\/.+\.js$/.test(newPath)) { | ||
var str = Util.readFileSync(path, 'utf-8'); | ||
str = fixModule(path, str); | ||
str = replaceTemplate(path, str); | ||
return callback('application/javascript', str); | ||
if(Fs.existsSync(path)){ | ||
var str = Util.readFileSync(path, 'utf-8'); | ||
str = fixModule(path, str); | ||
str = replaceTemplate(path, str); | ||
return callback('application/javascript', str); | ||
}else{ | ||
return console.error('Not find File: '+ path) | ||
} | ||
} | ||
@@ -157,0 +161,0 @@ |
270401
6007