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

koa-deploy-webpack-plugin

v1.0.6

Published

Automatic deployment project

Downloads

3

Readme

koa-deploy-webpack-plugin

介绍

该插件可以帮助你将打包后的文件自动上传到服务器并进行部署。

前提

该插件本质上是通过koa-static-history创建一个静态服务脚本,并通过pm2命令执行该脚本。也就是说你的服务器必须有安装有pm2

安装

npm i koa-deploy-webpack-plugin -D
yarn add koa-deploy-webpack-plugin -D

配置选项

  • ssh:通过该选项进行ssh连接的配置。该插件中ssh的连接使用的是node-ssh中的ssh.connect进行连接。可以通过node-ssh 查看该选项的其他配置。
  • project:配置项目名称,项目存储路径,项目运行端口号。
  • compress:对文件进行压缩。内部使用的是compress-webpack-plugin进行文件压缩,默认会开启gizp压缩。如果想要进行更加详细的配置,可以查看compress-webpack-plugin
  • staticConfig:对静态服务进行配置。例如配置开启history模式,配置文件的缓存时间等等。可以如果想要进行更加详细的配置,可以查看koa-sents
const KoaDeployWebpackPlugin = require("koa-deploy-webpack-plugin");

module.exports = {
 output: {
   clean: true,
 },
 plugins: [
   new HtmlWebpackPlugin(),
   new KoaDeployWebpackPlugin({
     ssh: {
       host: "", // 你的服务器地址,例如 111.111.111.111
       port: 22, // ssh连接的端口号,默认为22
       username: "root", // 连接服务器的用户名,默认为root
       password: "", 
     },
     project: {
       name: "cf_deploy_project", // 你的项目目录名, 默认为cf_deploy_project
       path: "/", // 项目存放于服务器的位置,默认为/
       port: 8080, // 项目运行的端口号,默认为8080
     },
     compress: {
       test: /\.(css|js)$/i,
     },
     staticConfig: {
       maxage: {   // 设置缓存时间
         html: 0,
         js: 100000,
       },
     },
   }),
 ],
};