Skip to content

Commit

Permalink
Fix a few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Oct 18, 2022
1 parent 7c6df66 commit e93d0ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
7 changes: 3 additions & 4 deletions packages/next/server/next-server.ts
Expand Up @@ -261,10 +261,9 @@ export default class NextNodeServer extends BaseServer {
}
}

private compression =
this.nextConfig.compress && this.nextConfig.target === 'server'
? (compression() as ExpressMiddleware)
: undefined
private compression = this.nextConfig.compress
? (compression() as ExpressMiddleware)
: undefined

protected loadEnvConfig({
dev,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/telemetry/events/version.ts
Expand Up @@ -91,7 +91,7 @@ export function eventCliSession(
hasNowJson: event.hasNowJson,
isCustomServer: event.isCustomServer,
hasNextConfig: nextConfig.configOrigin !== 'default',
buildTarget: nextConfig.target === 'server' ? 'default' : nextConfig.target,
buildTarget: 'default',
hasWebpackConfig: typeof nextConfig?.webpack === 'function',
hasBabelConfig: hasBabelConfig(dir),
imageEnabled: !!images,
Expand Down
Expand Up @@ -19,7 +19,6 @@ describe('Config Experimental Warning', () => {
configFile.write(`
module.exports = (phase, { defaultConfig }) => {
return {
target: 'server',
...defaultConfig,
}
}
Expand All @@ -32,7 +31,7 @@ describe('Config Experimental Warning', () => {
it('should not show warning with config from object', async () => {
configFile.write(`
module.exports = {
target: 'server'
images: {},
}
`)
const { stderr } = await nextBuild(appDir, [], { stderr: true })
Expand All @@ -42,7 +41,6 @@ describe('Config Experimental Warning', () => {
it('should show warning with config from object with experimental', async () => {
configFile.write(`
module.exports = {
target: 'server',
experimental: {
newNextLinkBehavior: true
}
Expand All @@ -57,7 +55,6 @@ describe('Config Experimental Warning', () => {
it('should show warning with config from function with experimental', async () => {
configFile.write(`
module.exports = (phase) => ({
target: 'server',
experimental: {
newNextLinkBehavior: true
}
Expand All @@ -72,7 +69,6 @@ describe('Config Experimental Warning', () => {
it('should not show warning with default value', async () => {
configFile.write(`
module.exports = (phase) => ({
target: 'server',
experimental: {
newNextLinkBehavior: false
}
Expand Down
2 changes: 0 additions & 2 deletions test/integration/required-server-files-ssr-404/next.config.js
@@ -1,6 +1,4 @@
module.exports = {
// ensure incorrect target is overridden by env
target: 'serverless',
rewrites() {
return [
{
Expand Down

0 comments on commit e93d0ce

Please sign in to comment.