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

versiongit-webpack-plugin

v1.0.5

Published

服务于 web端

Downloads

80

Readme

versiongit-webpack-plugin

服务于 web端

description

自动化控制当前 版本的 对于 webpack 的插件

effects

  1. 自动化 修改 package.json 并针对性的 修改 对应的version
  2. 获取 当前最新 git 的 commit 版本 和 tag值 以及 时间
  3. 动态 注入到 web项目 中 在 命令行中 有对应的 显示

usage

  1. 在对应 的 scripts 的命令行 键入 --ver=[major|minor|patch] 更新对应的版本:
  major: 'major', // update first
  minor: 'minor', // update second
  patch: 'patch', // update third
  1. 可以 不键入 version 字段,默认 会 更新 patch 版本
  1. 开启或者 禁用 此插件 enable 来控制
  1. 键入 desc 用于生成 description.json 用于记录更新信息

example

  1. 普通的 webpack 应用中的使用
  const path = require('path')
  const { VersiongitWebpackPlugin } = require('versiongit-webpack-plugin')
  new VersiongitWebpackPlugin({
    package_url: path.resolve(__dirname, '../package.json'), // package.json的路径
    git_url: path.resolve(__dirname, './'), // .git文件的路径
    enable: process.env.NODE_ENV === 'production', // 是否开启 版本 只能在 build 的时候开启
    desc: {
      update: {
        1: '更新信息1',
        2: '更新信息2',
        3: '更新信息3'
      }
    }
  })
  1. 如果是想在 vue-cli 应用中使用
  // 找到 对应的 vue.config.js 中的 configureWebpack => plugins 中
  // 在上面的 基础上,默认的 vue-cli-service build 的 时候 默认 会 打包两次包括 legacy bundle和 prod bundle;
  const path = require('path')
  const { VersiongitWebpackPlugin } = require('versiongit-webpack-plugin')
  new VersiongitWebpackPlugin({
    package_url: path.resolve(__dirname, '../package.json'), // package.json的路径
    git_url: path.resolve(__dirname, './'), // .git文件的路径
    enable: process.env.NODE_ENV === 'production' && !(process.env.VUE_CLI_MODERN_MODE && !process.env.VUE_CLI_MODERN_BUILD), // 是否开启 版本 只能在 build 的时候开启
    desc: {
      update: {
        1: '更新信息1',
        2: '更新信息2',
        3: '更新信息3'
      }
    }
  })