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

vue-cafeui

v0.1.6

Published

## 安装 ``` npm install vue-cafeui --save ``` ## 使用

Readme

vue-cafeui

安装

npm install vue-cafeui --save

使用

按需引入

import {CafeButton} from 'vue-cafeui'

全局注册

import vueCafeui from 'vue-cafeui'
Vue.use(vueCafeui)

npm包发布流程

  1. 执行打包命令输出库umd文件
npm run lib
  1. git提交代码
  2. 使用npm version命令来更新版本号,并提供更新信息。
npm version patch -m "Fix a bug"
  1. 发布
npm publish

vue组件项目搭建

  1. 使用vue-cli快速搭建一个vue2.x项目。
  2. 修改vue.config.js文件配置。
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  productionSourceMap: false,
  configureWebpack: {
    output: {
      library: 'vue-cafeui', // 这里是你的组件库名称
      libraryTarget: 'umd',
      libraryExport: 'default',
    },
  },
  css: {
    extract: false // 禁用样式提取, 否则打包完组件以后会自动分离出css文件需要再引入一个css文件,大项目适合分离,这里是个demo就不分离了
  }
})
  1. 创建一个lib文件夹用来存放打包后的js文件。
  2. 修改package.json文件设置入口文件为打包后的js文件。
{ 
    "main": "lib/vue-cafeui.umd.min.js",
}
  1. package.json里增加一个打包指令:
 "lib": "vue-cli-service build --target lib --name vue-cafeui --dest lib src/packages/index.js"
  1. 创建打包入口文件src/packages/index.js。
import CafeButton from '@/components/CafeButton.vue';
import CafeTitle from '@/components/CafeTitle.vue';

export const components = [
    CafeButton,
    CafeTitle
]

const install = (Vue) => {
    Object.values(components).forEach((component) => {
        Vue.component(component.name, component);
    });
}

/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
    install(window.Vue);
}

export default {
    install,
    CafeButton,
    CafeTitle
}

额外说明

  1. package.json中的运行时依赖这里我全部去掉了,因为使用的是打包后的umd.js文件。把原本有的vue和core-js依赖放到了devDependencies中。
  2. 有关依赖可以看看peerDependencies