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

@planjs/webpack-deploy-plugin

v0.0.19

Published

The webpack plugin handles various uploads of front-end files

Downloads

19

Readme

webpack-deploy-plugin

npm test

The plugin currently only supports rsync and oss-upload-tool. If it is rsync, you need to confirm whether the environment supports rsync.

Install

Using npm:

npm install @planjs/webpack-deploy-plugin --save-dev

Using yarn:

yarn add @planjs/webpack-deploy-plugin -D

Usage

webpack.Stats All output content will be uploaded to the server, or oss. webpack.config.js

const WebpackDeployPlugin = require('@planjs/webpack-deploy-plugin')

module.exports = {
    plugins: [
      new WebpackDeployPlugin({
        targets: {
          oss: {
            type: 'oss',
            // oss deploy folder
            dest: '/app/test1/',
            patterns: ['**', '!**.js.map'],
            OSSUploadOptions: {
              type: 'COS',
              COSOptions: {
                SecretId: 'xxx',
                SecretKey: 'xxx'
              },
              uploadParams: {
                Bucket: 'xxx',
                Region: 'xxx'
              }
            }
          },
          rsync: {
            type: 'rsync',
            patterns: ['**', '!**.js.map'],
            dest: '[email protected]:/www/deploy folder'
          }
        },
        // The key of the `targets` used
        env: 'oss'
      })
    ]
};

Options

targets

Upload configuration collection.
Type: Record<any, TargetItem> | TargetItem

env

If there are multiple upload configurations, it will be switched according to this as the key.
Type: string

TargetItem

type

Type: rsync | oss
How to upload files.

dest

Upload to server folder.

type oss folder default ''
type rsync server connection string [email protected]:/www/deploy folder

Type: string

patterns

Type: string | string[] multimatch
Paths based on compilation.assets or output folder matching will be uploaded.

isUploadOutputDir

Type: boolean
Default: false By default, the file of compilation.assets is used, and when it is turned on, all the output folders will be uploaded.

rsyncOptions

Rsync args.
Type: { args: string[][] }

eg: ['bwlimit', 10] rsync

OSSUploadOptions

Type: object

Detailed reference oss-upload-tool
It also supports related environment variable configuration.

maxAttempts

Type: number
Maximum number of failed retries.
Only valid for oss-upload-tool, rsync does not need to retry.

timeout

Type: number
Execution timeout.
If it is rsync, it is the timeout period for executing the command. If it is oss-upload-tool, it is the single file upload timeout period.

onUploadStart

Type: (stats: Stats, shelljs) => void | Promise<void>
Before upload event.

onUploadFinish

Type: (stats: Stats, shelljs) => void | Promise<void>
Upload complete event.

execUploadStartScripts

Type: string[][] | string[]
before Upload start exec script.

Detailed reference execa

execUploadFinishScripts

Type: string[][] | string[]
before Upload finish exec script.

Detailed reference execa

FQA

Window Rsync error: The command line is too long

By default, window will use 8191 as the longest length, leave 100 for other parameters, and if the remaining length is too long, it will become multiple rsync commands.
If it still fails, it may be an environment problem, change the cutting rules through the variable MAX_COMMAND_LINE_LIMIT.

License

MIT © fupengl