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

dndc-pudge-basic

v1.1.121

Published

## 安装依赖

Downloads

3

Readme

react 组件库脚手架

安装依赖

  • node.js 需要 10 以上的版本,下面提供 nvm 方式安装
$ nvm install 10.16.3
$ nvm use 10.16.3
# 设置默认node版本
$ nvm alias default v10.16.3
# npm 设置淘宝源
$ npm config set registry https://registry.npm.taobao.org
  • 本地开发
# 依赖包安装
$ npm install
# 启动开发环境
$ npm run start
# changelog生成
$ npm run changelog
  • 发布
npm run build
git tag -a 1.0.1 -m '备注'
git push origin 1.0.1

模块调试

特定场景需要在应用项目调试模块, 又不想每次提交 git,再执行npm i命令来查看效果,导致效率低。 可以使用yarn link

 // 进入私有包目录
 cd pudge
 // 创建`link`
 yarn link
 // 进入项目目录
 cd ../chebaba
 // 将`@dndc/pudge-basic` link到项目
 yarn link @dndc/pudge-basic
 // 取消link
 yarn unlink @dndc/pudge-basic

FAQ

package.json 中的 module 作用?

早期 npm 包基于commonJS规范,形式如下

"name": "@dndc/pudge-basic",
"version": "1.0.0",
"main": "lib/index.js",

require('@dndc/pudge-basic')的时候,会根据main字段查找入口文件. 而es2015,js拥有了ES Module,比之前的模块化方案更加优雅。 其中一个优点tree shaking能把我们我们JS中无用的代码去掉。

commonJS规范的包是以 main 字段表示入口文件,如果使用ES Module也用main字段,会造成冲突, 所以添加module,形式如下

"name": "@dndc/pudge-basic",
"version": "1.0.0",
"main": "lib/index.js",
"module": "es/index.js",

webpack从版本 2 开始也可以识别pkg.module字段。 如果存在module字段,会优先使用。

参考链接