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

dd-script

v1.3.0

Published

打包工具开发中

Downloads

5

Readme

dd-script

打包工具开发中

使用教程

  1. 在package.json中增加 browserslist
"browserslist": {
    "production": [
      "last 2 Chrome versions",
      "ie >= 11",
      "Firefox >= 20",
      "iOS 9",
      "> 5%"
    ],
    "development": [
      "last 2 Chrome versions",
      "ie >= 11",
      "Firefox >= 20",
      "iOS 9",
      "> 5%"
    ]
  }
  1. 项目根目录增加 .babelrc 文件
{
  "presets": [
    [
      "@babel/preset-react", {
        "runtime": "automatic"
      }
    ],
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "corejs": 3
      }
    ]
  ],
  "plugins": [
    [
      "@babel/plugin-transform-runtime",
      {
        "corejs": 3,
        "helpers": false
      }
    ]
  ]
}
  1. package.json 中修改scripts
"scripts": {
    "build": "dd-script build",
    "dev": "dd-script dev",
    "clear": "dd-script clear"
},
  1. 项目根目录增加配置文件 .dd.js
module.exports = {
    buildPath: "build", // 编译目录,默认build目录
    releasePath: "release", // 生成打包目录
    assetsDir: "app", // 静态资源包裹目录
    useMerroyBuild: true, // 使用内存编译,否则开发环境编译文件会写入buildPath目录
    publicPath: {
        dev: "./", // 开发环境output的publicPath, 当useMerroyBuild为true时,此配置无效
        prd: "./" // 生产环境output的publicPath
    },
    devtool: "", // 开发环境下使用这个配置,默认 cheap-module-source-map
    devServer: {
        host: "", // 配置host,默认 0.0.0.0
        port: "3456", // 不指定端口号,默认3000
        publicPath: "",
        open: true, // 自动打开浏览器
    },
    useVConsole: true, // 是否启用vconsole,会自动插入vconsole.min.js,以及初始化脚本。不需要配置insertHtml
    useAnalyzer: false, // 是否使用打包分析
    insertHtml: { // 向html插入额外的脚本
        beforeInner: ["./lib/sensorsdata.min.js"], // 向webpack生成的脚本之前插入script, vconsole.min.js不需要配置
        afterInner: [] // 向webpack生成的脚本之后插入script
    },
    useReactRefresh: true, // 使用热更新,开发环境下使用
    cacheTimeout: 7, // cache 失效时间,单位天,默认7天
    // babelTransformContains: [], // es6转成es5 例如:["node_modules/lodash-es"]
    // rules: [], // 额外webpack的rule规则
    // plugins: {
    //     dev: [], // 开发环境下额外增加的插件
    //     prd: [] // 生产环境下额外增加的插件
    // },
    useMock: true, // 是否启用mock,根目录下新建mocks文件夹
    reactVendor: [ // 如果引用了下面包,就会打包到 reactRel.min.js 中
        "react",
        "react-dom",
        "react-transition-group",
        "react-router",
        "react-router-dom",
        "redux",
        "redux-thunk",
        "react-redux"
    ],
    libVendor: [ // 如果引用了下面包,就会打包到 lib.min.js 中
        "antd-mobile",
        "bignumber.js",
        "immer",
        "@reduxjs",
        "better-scroll"
    ]
}
  1. mock文件
const router = require('koa-router')()

router.get('/', async (ctx, next) => {
  ctx.body = {
    title: "123",
    a: 12
  }
})

module.exports = router