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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hm-mpa-build

v0.1.0

Published

static web app workflow

Readme

hm-mpa-build

一个基于gulp的构建工具。

为了提供更好的扩展性,约定大于配置。我们希望用户在项目的根目录下创建一个build.config.js文件作为该构建工具的配置文件。

usage

我们可以提供类似于这种配置。

build: {
  src: 'src',
  dist: 'dist',
  temp: 'temp',
  public: 'public',
  paths: {
    styles: 'assets/styles/*.scss',
    scripts: 'assets/scripts/*.js',
    pages: '*.html',
    images: 'assets/images/**',
    fonts: 'assets/fonts/**'
  }
},
data: {

}

我们可以使用该构建工具的一些命令,为我们构建项目。

"scripts": {
  // 清除打包
  "clean": "hm-mpa-build clean",
  // 打包
  "build": "hm-mpa-build build",
  // 运行项目预览
  "dev": "hm-mpa-build dev"
},

一些项目介绍

bin/index.js

cli入口文件。

我们可以将gulp封装到该构建工具里,不需要外界再去安装gulp工具,直接通过配置一些命令就可以实现,然后项目使用直接通过我们构建工具的脚手架来执行构建操作即可。

// 赋值脚本执行时的参数
// 指定教本执行的工作目录,将其指向项目运行目录。
process.argv.push('--cwd')
process.argv.push(process.cwd())
// 将gulp配置文件指向当前构建工具的入口文件
process.argv.push('--gulpfile')
process.argv.push(require.resolve('..'))

// 执行gulp的脚手架
require('gulp/bin/gulp')

对于发布包的介绍

默认情况下,我们项目下的文件都会被发布出去,如果想要一些文件夹发布,我们需要在package.json中配置files属性指定哪些文件夹需要被发布。

package.json中的main指定项目的入口文件,bin指定项目脚手架的入口文件。