# fis3-deploy-zl-zip **Repository Path**: icode2017/fis3-deploy-zl-zip ## Basic Information - **Project Name**: fis3-deploy-zl-zip - **Description**: FIS3 生成 zip 插件 - **Primary Language**: JavaScript - **License**: BSD-2-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-02-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README fis3-deploy-zl-zip ================== 用来在 fis3 deploy 阶段用 zip 的方式打包资源。 在原有 fis3-deploy-zip 插件的基础上新增 startWithPath 参数,用于配置 zip 打包的起始目录。 新增对 __ (两个下划线) 开头的文件进行过滤 startWithPath 参数必须是以 / 开头,以 / 结尾。 如: ``` /src/page/web1/... // 如果想将 /src/page/web1/ 下所有的文件直接打成 zip 包。 fis.match('**', { deploy: [ fis.plugin('zl-zip',{ startWithPath: '/src/page/web1/' }), fis.plugin('local-deliver', { to: './output' }) ] }) ``` ## 安装插件 全局安装 ```bash npm install -g fis3-deploy-zl-zip ``` 或者本地安装到项目所在目录。 ```bash npm install fis3-deploy-zl-zip ``` ## 配置 ```javascript fis.match('**', { deploy: [ fis.plugin('zl-zip'), fis.plugin('local-deliver', { to: './output' }) ] }) // 或者 fis.match('*.tpl', { deploy: [ fis.plugin('zl-zip', { filename: 'templates.zip' }), fis.plugin('local-deliver', { to: './output' }) ] }) ``` ## 配置说明 * `filename` 默认为 `all.zip` 用来配置打包的文件名 * `keep` 默认为 `false` 是否保留零碎文件。 * `modified`: 默认为 `false` 是否只打包上次修改过的文件。默认是所有文件都打包。 * `startWithPath`: 默认为 `` 起始打包的目录位置。 ## NPM 发布 ``` npm config set registry http://registry.npmjs.org npm login Username: 输入你在npmjs.org上注册的用户名 Password: Email:(this IS public): npm publish . ```