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 🙏

© 2026 – Pkg Stats / Ryan Hefner

grunt-kissy-dp

v0.2.6

Published

nsell 用於解決代碼打包,依賴生成等功能為一體的編譯方案。

Readme

grunt-kissy-dp

针对kissy依赖做二次处理。针对目录做别名解析。

警告:插件目前是针对特定的目录结构来实现的,所以不建议其他人使用~

Getting Started

依赖 Grunt ~0.4.1

安装包

npm install grunt-kissy-dp --save-dev

加载包

grunt.loadNpmTasks('grunt-kissy-dp');

The "kissy_dp" task

Overview

grunt.initConfig({
  kdp: {
    options: {
      // kmc需要的包配置,对应的path为脚本所在的路径
      page: [
          {
              name: 'widget',
              path: srcPagePath,
              charset: 'utf-8'
          }
      ],
      // kmc见:https://github.com/daxingplay/grunt-kmc
      common: [
          {
              name: "common",
              path: srcPath,
              charset: 'utf-8'
          }
      ],
      // 页面级配置文件,若没有对应的文件或文件内容为空,则忽略。
      configFile: srcPagePath + "/config.json",
      // 依赖文件输出的路径
      dependsFile: srcPagePath + "/depends.json",
      commonDepend: srcCommonPath + "/depends.json",
      buildDepends: buildPagePath + "/" + market + "/dep.js",
      minify: true
    },
    files: [
         {
             expand: true,
             cwd: srcPagePath,
             src: [
                 'widget/*/index.js'
             ],
             dest: buildPagePath,
             ext: '.js'
         }
     ]
  }
})

Options

// kmc需要的包配置,对应的path为脚本所在的路径
page: [
  {
      name: 'widget',
      path: srcPagePath,
      charset: 'utf-8'
  }
],
// kmc见:https://github.com/daxingplay/grunt-kmc
common: [
  {
      name: "common",
      path: srcPath,
      charset: 'utf-8'
  }
],
// page级别的依赖信息输出的路径
dependsFile: srcPagePath + "/depends.json",
// common目录的依赖信息输出的路径
commonDepend: srcCommonPath + "/depends.json",
// 最终的依赖文件输出的路径。这个文件需要优先被加载到页面中~
buildDepends: buildPagePath + "/" + market + "/dep.js",
// 依赖文件内容是否压缩
minify: true

attention

widget目录下的模块目录下的index.js为入口文件开始分析处理。

  1. 对文件路径进行分析,获得dirName(widget的名称)和baseName(除去dirName的widget的路径)。
  2. 配置正则表达式避免同级目录相互引用。同级的widget下相互之间不允许requires。避免模块间的直接依赖。
  3. 配置kmc,添加page目录的配置,对widget目录下的文件进行打包。即,widget目录内的requires会被打包到一起。
  4. 添加common的配置,用于依赖分析。依赖分析是调用了kmc.combo方法。
  5. 对生成的依赖信息进行二次处理。
    1. 获取当前kissy模块的依赖。
    2. 排除掉与当前分析的文件同目录的文件。若是不是同目录的文件或是样式文件才保留。(因为文件会打包在一起,不需要另外添加这个依赖)
    3. 排除掉相同的依赖。比如一些基础依赖node/event/io等。
  6. 生成每一个页面级的依赖信息文件,输出到页面目录下。该文件显示了当前页面中的所有widget的依赖。
  7. 对所有依赖信息进行合并,生成用于KISSY分析的依赖文件。
    1. 若没有依赖,就不添加到依赖配置中。
    2. 若依赖了common的组件,则获取到该组件的依赖信息
    3. 合并页面的依赖和common的依赖。
    4. 输出依赖文件到build目录下。

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)