Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Weeken/farm-plugin-compression
A rust plugin for farm to compress resources.
https://github.com/Weeken/farm-plugin-compression
Last synced: about 2 months ago
JSON representation
A rust plugin for farm to compress resources.
- Host: GitHub
- URL: https://github.com/Weeken/farm-plugin-compression
- Owner: Weeken
- Created: 2024-04-10T10:31:25.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-25T10:25:47.000Z (5 months ago)
- Last Synced: 2024-09-25T23:49:22.250Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 325 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-farm - `farm-plugin-compression`
- awesome-farm - `farm-plugin-compression`
README
## farm-plugin-compression
A rust plugin for [farm](https://github.com/farm-fe/farm) to compress resources.
### Install
```bash
pnpm add -D farm-plugin-compression
```> [!NOTE]
> "@farmfe/core": "^1.2.0" --> "farm-plugin-compression": "0.0.4"
> "@farmfe/core": "^1.3.0" --> "farm-plugin-compression": "^0.1.x"### Usage
```ts
import { defineConfig } from "@farmfe/core";
import compression from "farm-plugin-compression";export default defineConfig({
plugins: [
[
"farm-plugin-compression",
{
level: "best", // level: "best" | "none" | "default" | "fast"
exclude: ["jpg", "png"], // resource type like jpg, png, and others generate in dist
},
],
// or
compression({ level: "best", exclude: ["jpg", "png"] }),
],
});
```