Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: precompress by default #11945

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/strong-rocks-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/adapter-node": major
---

breaking: change default value of `precompress` option to true to serve precompressed assets by default
4 changes: 2 additions & 2 deletions documentation/docs/25-build-and-deploy/40-adapter-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default {
adapter: adapter({
// default options are shown
out: 'build',
precompress: false,
precompress: true,
envPrefix: ''
})
}
Expand All @@ -145,7 +145,7 @@ The directory to build the server to. It defaults to `build` — i.e. `node buil

### precompress

Enables precompressing using gzip and brotli for assets and prerendered pages. It defaults to `false`.
Enables precompressing using gzip and brotli for assets and prerendered pages. It defaults to `true`.

### envPrefix

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const files = fileURLToPath(new URL('./files', import.meta.url).href);

/** @type {import('./index.js').default} */
export default function (opts = {}) {
const { out = 'build', precompress, envPrefix = '' } = opts;
const { out = 'build', precompress = true, envPrefix = '' } = opts;

return {
name: '@sveltejs/adapter-node',
Expand Down
Loading