code: function libPkgPre() {
      var obj = {
              name: '',
              version: config.version,
              spm: config.spm
          },
          libCon, libsjs = '',
          key,
          libDir = dist_dir.js + '';
      obj.spm.main = 'libs.js';
      obj.spm.buildArgs = '--idleading {{name}} --include all';
  
      libCon = JSON.stringify(obj);
      fs.renameSync('package.json', 'package_bak.json');
      fs.writeFileSync('package.json', libCon); //生成库文件pkg配置
      var packages = [];
      for (key in obj.spm.dependencies) {
          if (obj.spm.inside[key]) {
              packages.push(obj.spm.inside[key]);
          } else {
              packages.push(key);
          }
      }
      for (var i = 0; i < packages.length; i++) {
          libsjs += "require('" + packages[i] + "');";
      }
  
  
      fs.writeFileSync('libs.js', libsjs); //写入口文件
      return libDir;
  }
docs: 库文件的入口文件和过程文件的生成