webpack-plugin-pack-war

1.0.1 • Public • Published

webpack-plugin-pack-war

一个基于archiver打包工具,用于将前端项目中的输出文件打包成.war或.zip方便通过web中间件部署到云服务器等。

    a plugin based on archiver to pack web project's output files to .war or .zip file.

安装

    npm i webpack-plugin-pack-war --save -D

快速开始

vue2.x

    const WebpackPluginPackWar = require("webpack-plugin-pack-war")
    module.exports = {
        plugins:[
            new WebpackPluginPackWar({
                {
                    buildType: "war",
                },
            })
        ]
    };

vue3.x

    module.exports = {
        chainWebpack: (config) => {
            config
            .plugin("webpack-plugin-pack-war")
            .use(require("webpack-plugin-pack-war"), [
                {
                    buildType: "war",
                },
            ]);
        },
    };

配置参数及说明

使用该插件会在编译输出目录同级目录创建一个名为 输出目录名+【-pkg】 的目录,并将打包文件生成在该目录下。

参数 buildType 的值可以是war或者zip,默认为zip

Package Sidebar

Install

npm i webpack-plugin-pack-war

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

16.6 kB

Total Files

6

Last publish

Collaborators

  • jackey_npm