10.0.10 • Published 7 years ago

isv-deps-json-webpack-plugin v10.0.10

Weekly downloads
3
License
ISC
Repository
gitlab
Last release
7 years ago

test lines coverage branches coverage functions coverage statements coverage

简介

基于 upx 的 deps.json 生成器,webpack 插件

使用方式

var getDepMap = require('./index');

// 默认给 模块 使用的配置
var depConfig = {
  dependencies: dependencies, // 一般取 package.json 中的 dependencies 内容
  modBasePath: 'upx',  // 模块路径
  comBasePath: 'npm',  // 组件路径前缀
  modName: '@ali/just-test',   // 模块名
  suffix: '.cmd',   // 生成依赖表的后缀
  entrySuffix: '', // 给主入口添加的后缀
  type: endType,  // 类型,主要有3种: 'origin'、'web' 或者 'native'
  
  // 控制项
  disableBuiltIn: false, // 是否开启内置包过滤,目前暂时没用到
  disableXtplReplace: false, // 默认生成 .xtpl 项,如果不想生成,需要disable 掉
  isDev: isDev   // 根据出否是在 dev 状态区分不一样的行为
};

getDepMap(depConfig).then(function(result){ // result 就是某个 endType 下的 deps.json 
    // ....
})

如何测试

一般来说,运行 npm run test 就能运行 test 文件夹下的所有测试用例;

某些情况下(比如debug),想要测试单个测试用例,需要使用 only 的场景,比如我就仅仅想测试 test/deps/cases/mod-empty 这个文件夹下的测试用例,此时仅仅需要将当前文件夹重命名为 only-mod-empty ,然后再执行 npm run test 即可;

相关的逻辑代码在 test/deps/index.test.js 中:

    // 增加only功能,方面单个功能测试
    if(/^(only\-)/.test(testCase)){
      it.only(testCase, testCurrentCase(testCase));
    } else {
      it(testCase, testCurrentCase(testCase));
    }

也可以拷贝成 only-mod-empty,测试完再删除就行了,怎么方便怎么来,总之以 only- 前缀开始

10.0.10

7 years ago

10.0.9

7 years ago

10.0.8

7 years ago

10.0.6

7 years ago

10.0.5

7 years ago

10.0.4

7 years ago

10.0.0

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.5

7 years ago