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

hx-zip-plugin

v1.1.0

Published

内部利用zip的压缩能力,生成需要部署的zip静态资源文件和zip压缩html文件

Downloads

9

Readme

支持配置需要认定为静态资源的文件夹,exp:

// 默认配置如下,基本可不写options参数
{
  static: ['js', 'css', 'fonts', 'img'], // 非必填项
  prefix: '', // 非必填项,文件路径前缀,例如父文件名(例如2022,2023等活动页资源路径)
  projectName: '' // 非必填项,项目名(一般会根据你当前项目名默认读取,如上线地址中的项目名与本地项目名不符时,需指定,其他情况可不填)
}

命令行工具安装

  npm install hx-zip-plugin -D

vue.config.js的配置引入方式

const HxZipPlugin = require('hx-zip-plugin');
// 1. 简单配置
chainWebpack: config => {
  config.
  ...
  .end()
  .plugin('hx-zip', {})
  .use(HxZipPlugin)
  .end()
  ...
// 2. 复杂配置(需配置可配置项情况下)
chainWebpack: config => {
  config.
  ...
  .end()
  .plugin('hx-zip', {})
  .use(HxZipPlugin)
  .tap(() => ([{
    prefix: '2022', // 2022年项目,并且要与其他年份项目区分开,防止静态资源重复出现覆盖情况下使用
    static: ['js', 'css', 'fonts', 'img'],// (非必填)需要放入静态资源的文件夹名称(基本不用配置,除特殊情况下配置例如:比默认资源数组中资源多的情况下配置)
  }]))
  .end()
  ...

老项目配置(一般在webpack.common.config.js中配置)

const HxZipPlugin = require('hx-zip-plugin');
new HxZipPlugin({
  prefix: '', // 非必填
  static: ['js', 'css', 'fonts', 'img'] // 非必填
});

新增选项mode

  • 可选值difficult(默认配置)
  • 'easy' 需添加,添加后仅对应的输出文件会生成zip

fix问题

  • v1.0.8 fix: 路径区分mac和windows @zhangbei