Comparing version 1.0.16 to 1.0.17
@@ -129,3 +129,3 @@ /** | ||
}, | ||
combo: function(inputFile, depFileName, depFileCharset, fixModuleName){ | ||
combo: function(inputFile, depFileName, depFileCharset, fixModuleName, returnDependencies){ | ||
var self = this, | ||
@@ -138,3 +138,3 @@ content, | ||
var c = new Compiler(config); | ||
c.analyze(inputFile); | ||
var result = c.analyze(inputFile); | ||
content = c.combo(fixModuleName); | ||
@@ -144,3 +144,3 @@ if(content && depFileName){ | ||
} | ||
return content; | ||
return returnDependencies === true ? { files: [result], success: true, modules: c.modules } : content; | ||
}, | ||
@@ -147,0 +147,0 @@ clean: function(){ |
@@ -68,3 +68,5 @@ /** | ||
var self = this; | ||
if(requiredModule.match(/^\./) && _.isObject(parentModule)){ | ||
if(requiredModule.match(/\.css/)){ | ||
return requiredModule; | ||
}else if(requiredModule.match(/^\./) && _.isObject(parentModule)){ | ||
return path.resolve(path.dirname(parentModule.path), utils.addPathSuffix(requiredModule)); | ||
@@ -124,3 +126,3 @@ }else if(!requiredModule.match(/\//) || requiredModule.match(/^gallery\//)){ | ||
if(filePath.match(new RegExp(pkg.name))){ | ||
isBelongPkg = true; | ||
isBelongPkg = true; | ||
} else if (pkg.ignorePackageNameInUri && dirname.indexOf(pkg.path) > -1) { | ||
@@ -205,2 +207,3 @@ //增加ignorePackageNameInUri支持,使用路径判断,如果pkg.path和 | ||
var self = this; | ||
if(!mod || !mod.path) return ''; | ||
var fileContent = fs.readFileSync(mod.path); | ||
@@ -388,6 +391,6 @@ var modContent = iconv.decode(fileContent, mod.charset); | ||
} | ||
if(fixModuleName === true){ | ||
if(fixModuleName === true && mod && mod.path){ | ||
var modContent = self._generateRealModuleContent(mod); | ||
var buffer = iconv.encode(modContent, mod.charset); | ||
fs.writeFile(mod.path, buffer); | ||
fs.writeFileSync(mod.path, buffer); | ||
} | ||
@@ -394,0 +397,0 @@ }); |
{ | ||
"name":"kmc", | ||
"version":"1.0.16", | ||
"version":"1.0.17", | ||
"description":"KISSY Module Compiler", | ||
@@ -5,0 +5,0 @@ "author":"daxingplay <daxingplay@gmail.com>", |
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
2766
103211