Skip to content

Weeken/farm-plugin-compression

Repository files navigation

farm-plugin-compression

A rust plugin for farm to compress resources.

Install

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

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"] }),
  ],
});

About

A rust plugin for farm to compress resources.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published