diff --git a/.changeset/strong-rocks-perform.md b/.changeset/strong-rocks-perform.md new file mode 100644 index 000000000000..6cf62c21f00e --- /dev/null +++ b/.changeset/strong-rocks-perform.md @@ -0,0 +1,5 @@ +--- +"@sveltejs/adapter-node": major +--- + +breaking: change default value of `precompress` option to true to serve precompressed assets by default diff --git a/documentation/docs/25-build-and-deploy/40-adapter-node.md b/documentation/docs/25-build-and-deploy/40-adapter-node.md index 44d0ff46dfed..143c62b3abcf 100644 --- a/documentation/docs/25-build-and-deploy/40-adapter-node.md +++ b/documentation/docs/25-build-and-deploy/40-adapter-node.md @@ -132,7 +132,7 @@ export default { adapter: adapter({ // default options are shown out: 'build', - precompress: false, + precompress: true, envPrefix: '' }) } @@ -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 diff --git a/packages/adapter-node/index.js b/packages/adapter-node/index.js index 2f9ab8ed441f..9b0b3158ab82 100644 --- a/packages/adapter-node/index.js +++ b/packages/adapter-node/index.js @@ -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',