code: function transform(dir, basepath,ignore) {
  	ignore = ignore || [];
  	basepath = basepath || options.basepath || pwd;
  	hfs.walk(dir, function(files) {
  		var allrquires = [];
  		files.forEach(function(file) {
  			var filename = file;
  			file = fs.readFileSync(path.resolve(pwd, file)).toString().replace(commentRegExp, "");
  			var isLitheJs = !! file.match(defineRegexp);
  			if (isLitheJs) {
  				//替换define
  				var id = filename.replace(basepath, '').replace(/\.js$/, '');
  				file = file.replace(defineRegexp, function($1, $2) {
  					return 'define("' + id + '"';
  				});
                  //转义require
                  file = file.replace(requireRegexp,function($1,$2){
                      var newrequire = path.join(dir,$2).replace(basepath,'');
                      return 'require("'+newrequire+'")';     
                  });
  				hfs.writeFileSync(filename, file);
  			}
  		});
  	},
  	{
  		filter: function(el) {
  			var ext = path.extname(el);
  			if (inIgnore(ignore, el) && ext.indexOf('.json') == - 1 && ext.indexOf('.js') > - 1) return true;
  		}
  	});
  }
docs: 转换目录文件define id为basepath 相对路径,转换替换所有匹配alias 原则上alias不自动生成了，还是以用户自定义为准