Skip to content

fix: include .txt files in precompress#15259

Merged
benmccann merged 3 commits intosveltejs:mainfrom
FrankFMY:fix-precompress-txt-files
Feb 15, 2026
Merged

fix: include .txt files in precompress#15259
benmccann merged 3 commits intosveltejs:mainfrom
FrankFMY:fix-precompress-txt-files

Conversation

@FrankFMY
Copy link
Contributor

@FrankFMY FrankFMY commented Feb 5, 2026

Summary

  • Add .txt to the list of file extensions eligible for precompression in builder.js
  • Text files like robots.txt and ads.txt are highly compressible and should be precompressed alongside other text-based assets like .html, .xml, and .svg

Closes #15170

Add .txt to the list of extensions eligible for precompression.
Text files like robots.txt and ads.txt are highly compressible
and should be precompressed alongside other text-based assets
like .html, .xml, and .svg.

Closes sveltejs#15170
@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: 160735f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svelte-docs-bot
Copy link

@FrankFMY
Copy link
Contributor Author

FrankFMY commented Feb 5, 2026

Added a changeset.

The failing CI check (test-kit-cross-browser / windows-latest / chromium / build) is a timeout in write_types/index.spec.js > Creates correct $types — unrelated to this change. All other 21 checks pass, including builder.spec.js which directly tests the precompression logic.

@dummdidumm dummdidumm marked this pull request as draft February 6, 2026 12:26
@dummdidumm
Copy link
Member

converting to draft while we decipher in the related issue what the reason was (if any) to omit .txt files from compression

Copy link
Member

@benmccann benmccann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should merge this. I don't think there was any reason .txt was left out

The original PR (5 years ago!) just didn't have it: #1693

@benmccann benmccann marked this pull request as ready for review February 6, 2026 19:59
@FrankFMY
Copy link
Contributor Author

FrankFMY commented Feb 6, 2026

I think we should merge this. I don't think there was any reason .txt was left out

The original PR (5 years ago!) just didn't have it: #1693

Thank you!

@benmccann benmccann merged commit 1bae374 into sveltejs:main Feb 15, 2026
22 checks passed
@github-actions github-actions bot mentioned this pull request Feb 15, 2026
elliott-with-the-longest-name-on-github pushed a commit that referenced this pull request Feb 18, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/adapter-cloudflare@7.2.8

### Patch Changes

- fix: skip comment lines in `_redirects` file
([#15325](#15325))

- Updated dependencies
\[[`e87efba`](e87efba),
[`71ddbc7`](71ddbc7),
[`1bae374`](1bae374),
[`20dfadf`](20dfadf),
[`8c2384a`](8c2384a)]:
    -   @sveltejs/kit@2.52.1

## @sveltejs/adapter-netlify@6.0.1

### Patch Changes

- fix: export Netlify config directly from the instrumented serverless
function ([#15335](#15335))

- Updated dependencies
\[[`e87efba`](e87efba),
[`71ddbc7`](71ddbc7),
[`1bae374`](1bae374),
[`20dfadf`](20dfadf),
[`8c2384a`](8c2384a)]:
    -   @sveltejs/kit@2.52.1

## @sveltejs/kit@2.52.1

### Patch Changes

- fix: clear stale preflight issues on subsequent valid form submissions
([#15281](#15281))


- chore: remove dependency on `sade`
([#15272](#15272))


- fix: include `.txt` files in precompression
([#15259](#15259))


- fix: escape backticks and dollar signs when creating inlined css
([#15320](#15320))


- fix: increment `form.pending` count before preflight validation
([#15279](#15279))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Feb 18, 2026
Copilot AI pushed a commit to Stadly/kit that referenced this pull request Mar 6, 2026
- Add `.txt` to the list of file extensions eligible for precompression
in `builder.js`
- Text files like `robots.txt` and `ads.txt` are highly compressible and
should be precompressed alongside other text-based assets like `.html`,
`.xml`, and `.svg`
Copilot AI pushed a commit to Stadly/kit that referenced this pull request Mar 6, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/adapter-cloudflare@7.2.8

### Patch Changes

- fix: skip comment lines in `_redirects` file
([sveltejs#15325](sveltejs#15325))

- Updated dependencies
\[[`e87efba`](sveltejs@e87efba),
[`71ddbc7`](sveltejs@71ddbc7),
[`1bae374`](sveltejs@1bae374),
[`20dfadf`](sveltejs@20dfadf),
[`8c2384a`](sveltejs@8c2384a)]:
    -   @sveltejs/kit@2.52.1

## @sveltejs/adapter-netlify@6.0.1

### Patch Changes

- fix: export Netlify config directly from the instrumented serverless
function ([sveltejs#15335](sveltejs#15335))

- Updated dependencies
\[[`e87efba`](sveltejs@e87efba),
[`71ddbc7`](sveltejs@71ddbc7),
[`1bae374`](sveltejs@1bae374),
[`20dfadf`](sveltejs@20dfadf),
[`8c2384a`](sveltejs@8c2384a)]:
    -   @sveltejs/kit@2.52.1

## @sveltejs/kit@2.52.1

### Patch Changes

- fix: clear stale preflight issues on subsequent valid form submissions
([sveltejs#15281](sveltejs#15281))


- chore: remove dependency on `sade`
([sveltejs#15272](sveltejs#15272))


- fix: include `.txt` files in precompression
([sveltejs#15259](sveltejs#15259))


- fix: escape backticks and dollar signs when creating inlined css
([sveltejs#15320](sveltejs#15320))


- fix: increment `form.pending` count before preflight validation
([sveltejs#15279](sveltejs#15279))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

precompress: true ignores .txt files in the static folder

4 participants