1.0.6 • Published 1 year ago

compressed-bundle v1.0.6

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

compressed-bundle

构建生成包完成后将包打包成zip和tar包的webapck插件

使用

npm i compressed-bundle

webpack.config.js

const CompressingFile = require("compressed-bundle")["compressed-bundle"];

module.exports = {
     plugins: [
       new CompressingFile([{
        type:"zip",
        path:path.resolve(__dirname,`./dist/`),
        target:path.resolve(__dirname,"./app/"),
        filename:`jwplugin`
        },{
          type:"tar",
          path:path.resolve(__dirname,`./dist/`),
          target:path.resolve(__dirname,"./app/"),
          filename:`jwplugin`
      }]),
 	]
 }

生成app文件夹,包含jwplugin.zip、jwplugin.tar压缩包

参数

构造函数参数options: array|object

array用于生成多个压缩包

options item:

字段含义类型必输
type压缩包类型 tar|zipstring
path需要打包的文件夹的绝对路径string否,默认文件输出目录(推荐输入,vue-cli等脚手架中可能会有bug)
target压缩包输出绝对路径string
filename压缩包名称string

注意:压缩包输出目录不可以是path子目录!比如输出目录是dist 压缩包目录就不可以是dist下的任意路径,可以是dist的同级目录或者上级目录都可以。

源代码:同级resource.js

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago