Comparing version 1.0.33 to 1.0.34
@@ -0,1 +1,7 @@ | ||
## 2014.02.20, Version 1.0.34(Stable) | ||
### bugfix | ||
- 如果模块没有找到,仍然加到依赖关系中,模块的包默认为unknown | ||
## 2014.01.18, Version 1.0.33(Stable) | ||
@@ -2,0 +8,0 @@ |
@@ -99,3 +99,3 @@ /** | ||
var lastPath = path.resolve(path.dirname(parentModule.path), utils.addPathSuffix(requiredModule)); | ||
return fs.existsSync(lastPath) ? lastPath : false; | ||
return fs.existsSync(lastPath) ? lastPath : requiredModule; | ||
}; | ||
@@ -272,6 +272,6 @@ Compiler.prototype._getModuleRealPathByPkg = function(filePath, pkg){ | ||
case null: | ||
!self.config.silent && console.log('cannot get package for %s, use the first path in require path instead.', inputFilePath); | ||
!self.config.silent && console.log('cannot get package for %s, guess it is kissy module.', inputFilePath); | ||
mod = { | ||
name: inputFilePath, | ||
pkg: self._getModuleNameFromRequire(inputFilePath), | ||
pkg: 'unknown' || self._getModuleNameFromRequire(inputFilePath), | ||
status: 'missing' | ||
@@ -278,0 +278,0 @@ }; |
{ | ||
"name": "kmc", | ||
"version": "1.0.33", | ||
"version": "1.0.34", | ||
"description": "KISSY Module Compiler", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -1206,2 +1206,36 @@ /** | ||
}); | ||
}); | ||
describe('When use kissy sub modules', function(){ | ||
var result; | ||
var inputFile = path.resolve(srcPath, 'package1/kissy-sub-module.js'), | ||
outputFile = path.resolve(distPath, 'package1/kissy-sub-module.js'); | ||
before(function(){ | ||
ModuleCompiler.config({ | ||
packages: { | ||
package1: { | ||
base: srcPath, | ||
charset: 'gbk' | ||
} | ||
}, | ||
silent: true, | ||
charset: 'gbk' | ||
}); | ||
result = ModuleCompiler.build({ | ||
src: inputFile, | ||
dest: outputFile, | ||
depPath: path.resolve(distPath, 'package1/kissy-sub-module.map.js'), | ||
}); | ||
}); | ||
after(function(){ | ||
ModuleCompiler.clean(); | ||
}); | ||
it('should have proper modules', function(){ | ||
var file = result.files[0]; | ||
console.log(file); | ||
file.autoCombo['package1/kissy-sub-module'].length.should.equal(4); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
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
125285
68
3486