Skip to content

Commit

Permalink
fix issue #16
Browse files Browse the repository at this point in the history
  • Loading branch information
daxingplay committed Jan 19, 2013
1 parent 529d6ac commit a522774
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Thumbs.db
out/
node_modules/
.log
projectFilesBackup/
10 changes: 7 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ var ModuleCompiler = {
suffix: '',
charset: '',
debug: false,
combine: false,
silent: false
},
_packages: {},
_mappedRules: [],
_moduleCache: {},
_analyzedFiles: [],
_combinedModules: [],
_dependencies: {},
_clean: function(){
this._moduleCache = {};
this._analyzedFiles = [];
this._combinedModules = [];
this._dependencies = {};
},
_parseConfig: function(cfg){
var self = this;
Expand All @@ -70,6 +73,7 @@ var ModuleCompiler = {
pkg.charset = '';
}
pkg.path = path.resolve(addPkgNameToPath(pkg.path, pkg.name)) || __dirname;
pkg.combine = !!pkg.combine;
if(fs.existsSync(pkg.path)){
self._packages[pkg.name] = pkg;
}
Expand Down Expand Up @@ -459,8 +463,7 @@ module.exports = {
* @return {Object}
*/
build: function(inputPath, outputPath, outputCharset){
var self = this,
target = path.resolve(inputPath),
var target = path.resolve(inputPath),
result = {
'success': true,
'files': []
Expand All @@ -487,7 +490,7 @@ module.exports = {
result.files.push(ModuleCompiler.build(modulePath, outputPath, outputCharset));
}else{
result.success = false;
!self._config.silent && console.info('[err]'.bold.red + ' cannot find target: %s', target);
!ModuleCompiler._config.silent && console.info('[err]'.bold.red + ' cannot find target: %s', target);
}
}
return result;
Expand All @@ -498,6 +501,7 @@ module.exports = {
ignoreFiles: [],
suffix: '',
charset: '',
combine: false,
silent: false
};
ModuleCompiler._packages = {};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"module-compiler",
"version":"0.0.6",
"version":"0.0.7",
"description":"kissy module compiler",
"author":"daxingplay <daxingplay@gmail.com>",
"homepage":"",
Expand Down

0 comments on commit a522774

Please sign in to comment.