Comparing version 0.6.5 to 0.7.0
@@ -6,3 +6,2 @@ var helper = require("../lib/util"); | ||
module.exports = function (htmljsfile, reqOpt, param, cb) { | ||
var _url = reqOpt.path; | ||
var MIME = "application/javascript"; | ||
@@ -58,28 +57,3 @@ | ||
var result = ''; | ||
var wrapper = param.define; | ||
var anonymous = param.anonymous; | ||
var packageName = '"' + helper.filteredUrl(_url, param.filter) + '"'; | ||
if (wrapper) { | ||
result = wrapper + '('; | ||
if (!anonymous) { | ||
result += packageName + ','; | ||
} | ||
if (wrapper == "define") { | ||
result += "function(require,exports,module){module.exports="; | ||
} | ||
else { | ||
result += "function(){return "; | ||
} | ||
result += compiled + "});"; | ||
} | ||
else { | ||
result = "window[" + packageName + "]=" + compiled; | ||
} | ||
cb(false, result, htmlfile, MIME); | ||
cb(false, helper.wrapper(compiled, reqOpt.path, param), htmlfile, MIME); | ||
} | ||
@@ -86,0 +60,0 @@ else { |
@@ -35,1 +35,30 @@ var fsLib = require("fs"); | ||
}; | ||
exports.wrapper = function (compiled, _url, param) { | ||
var result = ''; | ||
var wrapper = param.define; | ||
var anonymous = param.anonymous; | ||
var packageName = '"' + exports.filteredUrl(_url, param.filter) + '"'; | ||
if (wrapper) { | ||
result = wrapper + '('; | ||
if (!anonymous) { | ||
result += packageName + ','; | ||
} | ||
if (wrapper == "define") { | ||
result += "function(require,exports,module){module.exports="; | ||
} | ||
else { | ||
result += "function(){return "; | ||
} | ||
result += compiled + "});"; | ||
} | ||
else { | ||
result = "window[" + packageName + "]=" + compiled; | ||
} | ||
return result; | ||
} |
{ | ||
"name": "dac", | ||
"version": "0.6.5", | ||
"version": "0.7.0", | ||
"description": "Dynamic Assets Compiler", | ||
@@ -20,6 +20,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"iconv-lite": "~0.4.11", | ||
"is-utf8": "~0.2.0", | ||
"clean-css": "~3.4.8", | ||
"iconv-lite": "~0.4.13", | ||
"is-utf8": "~0.2.1", | ||
"juicer": "~0.6.11", | ||
"less": "~2.5.1" | ||
"less": "~2.5.3" | ||
}, | ||
@@ -26,0 +27,0 @@ "author": "limingv5", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10689
10
324
5
+ Addedclean-css@~3.4.8
+ Addedclean-css@3.4.28(transitive)
+ Addedcommander@2.8.1(transitive)
+ Addedgraceful-readlink@1.0.1(transitive)
Updatediconv-lite@~0.4.13
Updatedis-utf8@~0.2.1
Updatedless@~2.5.3