Skip to content

Commit

Permalink
feat: make compress configurable in standalone mode (#33717)
Browse files Browse the repository at this point in the history
Fixes #33696

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
  • Loading branch information
balazsorban44 committed Jan 27, 2022
1 parent c551a32 commit 0d642f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 1 addition & 5 deletions packages/next/build/index.ts
Expand Up @@ -551,11 +551,7 @@ export default async function build(
.traceChild('generate-required-server-files')
.traceFn(() => ({
version: 1,
config: {
...config,
compress: false,
configFile: undefined,
},
config: { ...config, configFile: undefined },
appDir: dir,
files: [
ROUTES_MANIFEST,
Expand Down
6 changes: 6 additions & 0 deletions test/production/required-server-files.test.ts
Expand Up @@ -107,6 +107,12 @@ describe('should set-up next', () => {
if (server) await killApp(server)
})

it('`compress` should be `true` by default', async () => {
expect(
await fs.readFileSync(join(next.testDir, 'standalone/server.js'), 'utf8')
).toContain('"compress":true')
})

it('should output middleware correctly', async () => {
expect(
await fs.pathExists(
Expand Down

0 comments on commit 0d642f1

Please sign in to comment.