@duo-common/compress-cli
v0.1.0
Published
duo-common @duo-common/compress-cli
Downloads
12
Readme
@duo-common/compress-cli
📦 Install
pnpm i @duo-common/compress-cli
命令行
在安装了 Compress 的项目中,你可以在 npm 脚本中使用 compress 脚本.
{
"scripts": {
"compress": "compress-cli"
}
}
compress 会默认去顺序查找配置文件 compress.config.ts\compress.config.js\compress.config.cjs\compress.config.mjs\compress.config.json
//compress.config.ts 示例
import { defineConfig } from "@duo-common/compress-cli";
export default defineConfig({
fileName: "iduo-site", //生成对应名字的压缩包
format: ["zip"], //"zip" | "tar" | "tgz" | "gzip"
entry: "./", //出口路径
input: "./dist", //入口路径, 与compressType类型对应, 如果是file类型,请带上文件后缀
compressType: "dir", //"file" | "dir"
});
命令行选项
| Options | |
| ------------------------ | ---------------------------------------------------------- |
| -v, --version
| Display version number |
| -c, <filename>
| Use a custom config file |
| --input, <file or dir>
| Use a dir of file Must |
| --entry, <entry>
| Use a dir of file default cwd |
| --no-config boolean
| Disable config file |
| --format
| Bundle format, "zip", "tar", "tgz", "gzip" , default:"zip" |
| --compressType
| Bundle format, "dir", "file" |