Skip to content

Commit

Permalink
breaking: precompress by default
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Mar 6, 2024
1 parent 873a09e commit 0377ad4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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

0 comments on commit 0377ad4

Please sign in to comment.