sveltejs / sveltejs/kit

precompress - please add configuration

Open
#10,789 9 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pkg:adapter-node pkg:adapter-static
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

Hello,
Precompress could use some configuration settngs for the adapters that support it.

Thank you!

Describe the proposed solution
  1. Allow to disable gzip or brotli. Something like {gzip: false, brotli: true}
  2. Add a minimum size of the assets that should be compressed. For example, do not compress anything under 1024 bytes. Compressing these tiny files can actually make them larger. Something like {minSize: 1024}
  3. Allow to control which assets are compressed. Something like {formats: [html, svg, js, css]}
Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the precompress implementation and the adapters that support it, then trace how their configuration is defined and passed through. Review the requested gzip/brotli toggles, minimum asset size, and format selection; the work is done when these settings consistently control compression for supported adapters and are covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.