1.0.1 • Published 5 months ago

unplugin-zip-pack v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Quick Start

npm i unplugin-zip-pack@latest -D # Or yarn/pnpm as you like

Configuration

export type Options = {
  /**
   * Input Dir
   * @default `./dist`
   */
  in?: string;
  /**
   * Output file name (with path)
   * @default `dist.zip`
   */
  out?: string;
  filter?: FilterFunction;
  /**
   * Switcher of enable plugin
   * @default true
   */
  enabled?: boolean;
  /**
   * Hook functions run pre/post compress. (if `enabled` is set to false, hooks won't run.)
   */
  hooks?: {
    pre?: Promise;
    post?: Promise;
  }
}

Usage

// vite.config.ts
import ZipPack from 'unplugin-zip-pack/vite'

export default defineConfig({
  plugins: [
    ZipPack({ /* options */ }),
  ],
})

// rollup.config.js
import ZipPack from 'unplugin-zip-pack/rollup'

export default {
  plugins: [
    ZipPack({ /* options */ }),
  ],
}

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-zip-pack/webpack')({ /* options */ })
  ]
}

// nuxt.config.js
export default {
  buildModules: [
    ['unplugin-zip-pack/nuxt', { /* options */ }],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-zip-pack/webpack')({ /* options */ }),
    ],
  },
}

// esbuild.config.js
import { build } from 'esbuild'
import ZipPack from 'unplugin-zip-pack/esbuild'

build({
  plugins: [ZipPack()],
})

1.0.1

5 months ago

1.0.1-alpha.0

6 months ago

1.0.0

9 months ago

0.0.1-beta.0

9 months ago