npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

isv-deps-json-webpack-plugin

v10.0.10

Published

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

Downloads

14

Readme

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- 前缀开始