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

@cauliflowerli/deploy

v1.0.10

Published

前端自动化部署的插件,用于打包完成后,根据传入的配置参数,自动将打包生成的dist文件夹上传到生产服务器

Downloads

4

Readme

webpack自动化部署插件

功能说明

一个webpack打包自动化部署插件,可以在打包完成后,根据配置的远程服务器的信息、文件路径等自动部署打包的静态文件通常是dist文件夹到配置指定的远程服务器上【该服务器通常是公司的测试服务器】,而无需开发人员手动部署。

使用

安装

//package.json

npm install @cauliflowerli/deploy

配置

//webpack.config.js

const MyPlugin = require('@cauliflowerli/deploy') //引入

...
plugins:[
  new MyPlugin(settings)  //实例化配置
]
...

配置项说明

const path=require("path")
const settings={
config: {
    host: '192.168.0.1',
    port: '10022',
    username: 'root',
    password: 'root'
  },
  remotePath: '/usr/index/wzdev/web', // 配置上传路径
  remoteParentDirectory: '/usr/index/wzdev/', // 配置上传路径的父级目录路径
  localPath: path.join(__dirname, 'web'), // 配置要上传的本地文件夹路径
  type: 'number', // 自动删除过期文件的方式,time:时间过期删除,number:数量过期删除【选择time方式时,删除interval天以前的所有历史文件;选择number方式时可以,删除当前打包文件记录第interval个之前的所有历史文件】
  interval: 5, // 历史版本间隔10个时间单位之前的打包文件自动删除【单位默认为:days天】【选择time方式时,删除interval天以前的所有历史文件;选择number方式时可以,删除当前打包文件记录第interval个之前的所有历史文件】
  unit: 'days', // moment插件中定义的时间单位格式,当type为time时,可以设置该项的时间单位,配合interval表示删除当前时间间隔interval时间单位之前的所有历史文件
  openAutoDeploy: true// 该配置项仅在打包时使用:为防止意外覆盖远程服务器上的正确文件,请勿将该配置项设置为true的情况下提交当前配置文件到远程仓库,你应该永远不要提交本地的当前文件
}
以上配置对象将作为插件的实例化时的参数传入