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

copy-then-auto-git

v2.0.7

Published

This is a plugin for copy assets, and auto git.It can help developers to publish code to remote repository.

Downloads

26

Readme

webpack插件 copy-then-auto-git

用于自动拷贝静态资源、自动提交到远程仓库

插件能帮助我们做什么?插件会按步骤自动进行以下工作

  • 在gitDir路径下切换branch分支
  • git pull远程仓库branch分支代码
  • 删除destination路径下资源
  • 拷贝source路径的资源到destination路径
  • git add、git commit、git push 推送到远程仓库的branch分支

前提

需要 Node 版本在 v8.0 以上

安装

npm install copy-then-auto-git -D

使用指南

支持的配置项:

  • source 静态资源需要拷贝的来源路径,必填项,无默认值
  • destination 静态资源需要拷贝到的目标路径,必填项,无默认值
  • gitDir 执行git命令的根路径,默认是publish
  • branch 执行git命令的分支名,默认是master
  • version 自动提交时的版本号,默认是当前时间的毫秒数
  • remove 是否删除旧文件,默认是删除
// 引入
const CopyThenAutoGit = require('copy-then-auto-git');

// 配置 Plugin
const copyThenAutoGit = new CopyThenAutoGit({
    source: 'build',
    destination: 'publish/www',
    gitDir: 'publish',
    branch: 'dev',
    version: new Date().getTime(),
    remove: false
});

// Webpack 的配置
module.exports = {
//...
 plugins: [
   copyThenAutoGit
   // ...
 ]
 // ...
}