一个简单易用的 CSS 和 JavaScript 文件压缩工具,支持批量处理和多语言界面。
A simple and easy-to-use CSS and JavaScript file compression tool with batch processing and multi-language interface support.
网盘下载(Download):https://hik.lanzouq.com/b0j0sxi5e 密码:ep86
CSS/JS 压缩工具 / CSS/JS Compressor
一个简单易用的 CSS 和 JavaScript 文件压缩工具,支持批量处理和多语言界面。
A simple and easy-to-use CSS and JavaScript file compression tool with batch processing and multi-language interface support.
功能特性 / Features
中文 / Chinese
- 🗂️ 文件夹选择 :支持选择包含 CSS/JS 文件的项目文件夹
- 📁 批量处理 :自动扫描并列出所有可压缩的.css 和.js 文件
- ✅ 灵活选择 :支持全选 / 取消全选,或单独选择需要压缩的文件
- 🗜️ 高效压缩 :使用 rjsmin 和 rcssmin 库进行高效的代码压缩
- 📊 压缩统计 :实时显示原始大小、压缩后大小和压缩比
- 📂 目录结构保持 :输出文件保持原有的目录结构
- 📋 项目文件复制 :可选择将整个项目的所有文件复制到输出目录
- 🌍 多语言支持 :自动检测系统语言,支持中文和英文界面
- 📈 进度显示 :实时进度条和状态提示
- 🚀 一键打开 :压缩完成后可直接打开输出目录
- ⚡ 多线程处理:后台处理,不阻塞用户界面
English
- 🗂️ Folder Selection: Support selecting project folders containing CSS/JS files
- 📁 Batch Processing: Automatically scan and list all compressible .css and .js files
- ✅ Flexible Selection: Support select all/unselect all, or individually choose files to compress
- 🗜️ Efficient Compression: Use rjsmin and rcssmin libraries for efficient code compression
- 📊 Compression Statistics: Real-time display of original size, compressed size, and compression ratio
- 📂 Directory Structure Preservation: Output files maintain original directory structure
- 📋 Project File Copying: Optional copying of all project files to output directory
- 🌍 Multi-language Support: Automatic system language detection, supports Chinese and English interfaces
- 📈 Progress Display: Real-time progress bar and status indicators
- 🚀 One-click Open: Direct access to output directory after compression
- ⚡ Multi-threaded Processing: Background processing without blocking user interface
系统要求 / System Requirements
- Python 3.7+
- Windows / macOS / Linux
- tkinter (通常随 Python 一起安装 / Usually installed with Python)
安装方法 / Installation
方法一:从源码运行 / Method 1: Run from Source
- 克隆或下载项目文件 / Clone or download project files
- 安装依赖包 / Install dependencies:
pip install -r requirements.txt
- 运行程序 / Run the program:
python app.py
方法二:使用可执行文件 / Method 2: Use Executable
直接下载并运行编译好的可执行文件(如果提供)。
Directly download and run the compiled executable file (if available).
使用说明 / Usage Instructions
中文说明
- 选择源文件夹 :点击”选择文件夹”按钮,选择包含 CSS/JS 文件的项目目录
- 加载文件 :点击”加载文件”按钮,程序会自动扫描并列出所有.css 和.js 文件
- 选择文件:
- 默认情况下所有文件都被选中
- 可以使用”全选”或”取消全选”按钮
- 也可以单独勾选 / 取消勾选特定文件
- 设置选项:
- 勾选”复制所有文件到输出文件夹”可以将整个项目复制到输出目录
- 开始压缩 :点击”开始压缩”按钮开始处理
- 查看结果:
- 进度条显示处理进度
- 文件列表显示每个文件的压缩统计信息
- 压缩完成后会显示”打开输出目录”按钮
English Instructions
- Select Source Folder: Click the “Select Folder” button to choose the project directory containing CSS/JS files
- Load Files: Click the “Load Files” button, the program will automatically scan and list all .css and .js files
- Select Files:
- All files are selected by default
- Use “Select All” or “Unselect All” buttons
- Or individually check/uncheck specific files
- Set Options:
- Check “Copy all files to output folder” to copy the entire project to the output directory
- Start Compression: Click the “Start Compress” button to begin processing
- View Results:
- Progress bar shows processing progress
- File list displays compression statistics for each file
- “Open Output Directory” button appears after compression is complete
输出说明 / Output Description
中文
- 输出目录位于源文件夹同级,命名为”原文件夹名_compress”
- 压缩后的文件保持原有的文件名和目录结构
- 如果选择了”复制所有文件”选项,整个项目结构都会被复制到输出目录
- 程序会显示每个文件的:
- 原始大小
- 压缩后大小
- 压缩比例
English
- Output directory is located at the same level as source folder, named “original_folder_name_compress”
- Compressed files maintain original filenames and directory structure
- If “Copy all files” option is selected, the entire project structure will be copied to output directory
- The program displays for each file:
- Original size
- Compressed size
- Compression ratio
依赖包 / Dependencies
rjsmin
: JavaScript 代码压缩 / JavaScript code compressionrcssmin
: CSS 代码压缩 / CSS code compression
故障排除 / Troubleshooting
中文
问题:程序提示缺少依赖包
- 解决方案:运行
pip install -r requirements.txt
安装所需依赖
问题:无法打开输出目录
- 解决方案:检查输出目录是否存在,或手动导航到源文件夹同级目录
问题:压缩失败
- 解决方案:检查源文件是否存在语法错误,或文件是否被其他程序占用
English
Issue: Program reports missing dependencies
- Solution: Run
pip install -r requirements.txt
to install required dependencies
Issue: Cannot open output directory
- Solution: Check if output directory exists, or manually navigate to the same level as source folder
Issue: Compression failed
- Solution: Check if source files have syntax errors, or if files are being used by other programs
许可证 / License
本项目采用 MIT 许可证。详见 LICENSE 文件。
This project is licensed under the MIT License. See LICENSE file for details.
贡献 / Contributing
欢迎提交问题报告和功能请求!
Welcome to submit issue reports and feature requests!
注意 / Note: 本工具仅用于压缩 CSS 和 JavaScript 文件,不会修改原始文件。/ This tool is only for compressing CSS and JavaScript files and will not modify original files.
- 功能特性 / Features
- 中文 / Chinese
- English
- 系统要求 / System Requirements
- 安装方法 / Installation
- 方法一:从源码运行 / Method 1: Run from Source
- 方法二:使用可执行文件 / Method 2: Use Executable
- 使用说明 / Usage Instructions
- 中文说明
- English Instructions
- 输出说明 / Output Description
- 中文
- English
- 依赖包 / Dependencies
- 故障排除 / Troubleshooting
- 中文
- English
- 许可证 / License
- 贡献 / Contributing