Comparing version 1.0.41 to 1.0.42
@@ -0,1 +1,5 @@ | ||
## 2014.11.19, Version 1.0.42(Stable) | ||
- merge pull request[#49](https://github.com/daxingplay/kmc/pull/49) | ||
## 2014.07.08, Version 1.0.41(Stable) | ||
@@ -2,0 +6,0 @@ |
@@ -21,3 +21,3 @@ /** | ||
function Compiler(config, op){ | ||
this.outputFilePath = op; | ||
this.outputFilePath = op; | ||
this.modules = {}; | ||
@@ -41,2 +41,7 @@ this.fileList = []; | ||
start = start + 5; | ||
} else { | ||
start = moduleContent.indexOf('define('); | ||
if(start != -1){ | ||
start += 7; | ||
} | ||
} | ||
@@ -463,14 +468,14 @@ } else { | ||
} | ||
// info by 拔赤 | ||
// 建议增加开关,是否写到目标路径,这样会便于用户自定义copy规则 | ||
// 2013-12-12 | ||
// bugfix:grunt-kmc配置comboOnly时,文件写的位置出错的bugfix | ||
if(comboOnly && comboOnly === true){ | ||
var tModName = mod.pkg ? modName.replace(mod.pkg.name, '') : modName; | ||
if(outputPath.indexOf(path.normalize(tModName)) >= 0){ | ||
fs.writeFileSync(outputPath, buffer); | ||
} | ||
} else { | ||
fs.writeFileSync(outputPath, buffer); | ||
} | ||
// info by 拔赤 | ||
// 建议增加开关,是否写到目标路径,这样会便于用户自定义copy规则 | ||
// 2013-12-12 | ||
// bugfix:grunt-kmc配置comboOnly时,文件写的位置出错的bugfix | ||
if(comboOnly && comboOnly === true){ | ||
var tModName = mod.pkg ? modName.replace(mod.pkg.name, '') : modName; | ||
if(outputPath.indexOf(path.normalize(tModName)) >= 0){ | ||
fs.writeFileSync(outputPath, buffer); | ||
} | ||
} else { | ||
fs.writeFileSync(outputPath, buffer); | ||
} | ||
} | ||
@@ -477,0 +482,0 @@ }); |
{ | ||
"name": "kmc", | ||
"version": "1.0.41", | ||
"version": "1.0.42", | ||
"description": "KISSY Module Compiler", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -1013,2 +1013,32 @@ /** | ||
describe('When fix module name with "define" format', function(){ | ||
var result; | ||
var inputFile = path.resolve(srcPath, 'package-with-define/module-with-define.js'), | ||
depFile = path.resolve(distPath, 'package-with-define/module-with-define-dep.js'), | ||
outputDir = path.resolve(distPath, './fix-module-name-with-define'); | ||
before(function(){ | ||
ModuleCompiler.config({ | ||
packages: [{ | ||
name: 'package-with-define', | ||
path: srcPath, | ||
charset: 'utf-8' | ||
}], | ||
silent: true | ||
}); | ||
result = ModuleCompiler.combo(inputFile, depFile, '', true, true, outputDir); | ||
}); | ||
after(function(){ | ||
ModuleCompiler.clean(); | ||
}); | ||
it('should have added module names to files', function(){ | ||
/package\-with\-define\/module\-with\-define/ | ||
.test(fs.readFileSync(path.resolve(outputDir, './package-with-define/module-with-define.js'))) | ||
.should.equal(true); | ||
}); | ||
}); | ||
describe('When pass an object as arguments for build', function(){ | ||
@@ -1015,0 +1045,0 @@ var result; |
132909
72
3671