File tree Expand file tree Collapse file tree 7 files changed +107
-111
lines changed Expand file tree Collapse file tree 7 files changed +107
-111
lines changed Original file line number Diff line number Diff line change 1
- import {
2
- ImageConfig ,
3
- imageConfigDefault ,
4
- } from 'next/dist/next-server/server/image-config' ;
1
+ import { ImageConfig , imageConfigDefault } from 'next/dist/server/image-config' ;
5
2
import { parse as parseUrl } from 'url' ;
6
3
import {
7
4
APIGatewayProxyEventV2 ,
Original file line number Diff line number Diff line change 1
1
import { IncomingMessage , ServerResponse } from 'http' ;
2
- import { ImageConfig } from 'next/dist/next-server/ server/image-config' ;
3
- import { NextConfig } from 'next/dist/next-server/ server/config' ;
4
- import { imageOptimizer as nextImageOptimizer } from 'next/dist/next-server/ server/image-optimizer' ;
5
- import Server from 'next/dist/next-server/ server/next-server' ;
2
+ import { ImageConfig } from 'next/dist/server/image-config' ;
3
+ import { NextConfig } from 'next/dist/server/config' ;
4
+ import { imageOptimizer as nextImageOptimizer } from 'next/dist/server/image-optimizer' ;
5
+ import Server from 'next/dist/server/next-server' ;
6
6
import nodeFetch , { RequestInfo , RequestInit } from 'node-fetch' ;
7
7
import { UrlWithParsedQuery } from 'url' ;
8
8
import S3 from 'aws-sdk/clients/s3' ;
Original file line number Diff line number Diff line change 17
17
},
18
18
"dependencies" : {
19
19
"aws-sdk" : " *" ,
20
- "next" : " 11.0.1 " ,
20
+ "next" : " 11.1.0 " ,
21
21
"node-fetch" : " 2.6.1"
22
22
},
23
23
"devDependencies" : {
Original file line number Diff line number Diff line change @@ -15,7 +15,16 @@ async function main() {
15
15
// Get all files from build dir
16
16
const buildFiles = glob . sync ( '**/*.js' , { cwd : buildDir , absolute : true } ) ;
17
17
18
- const { fileList } = await nodeFileTrace ( buildFiles , {
18
+ // Squoosh files
19
+ const squooshFiles = glob . sync (
20
+ 'node_modules/next/dist/server/lib/squoosh/**/*.js' ,
21
+ {
22
+ cwd : workspaceRoot ,
23
+ absolute : true ,
24
+ }
25
+ ) ;
26
+
27
+ const { fileList } = await nodeFileTrace ( [ ...buildFiles , ...squooshFiles ] , {
19
28
base : workspaceRoot ,
20
29
processCwd : process . cwd ( ) ,
21
30
// aws-sdk is already provided in Lambda images
@@ -29,15 +38,6 @@ async function main() {
29
38
'node_modules/next/node_modules/jest-worker/build/workers/threadChild.js'
30
39
) ;
31
40
32
- fileList . push (
33
- ...glob . sync (
34
- 'node_modules/next/dist/next-server/server/lib/squoosh/**/*.{js,wasm}' ,
35
- {
36
- cwd : workspaceRoot ,
37
- }
38
- )
39
- ) ;
40
-
41
41
// Create zip file
42
42
await new Promise ( ( resolve , reject ) => {
43
43
const outputFile = fs . createWriteStream (
Original file line number Diff line number Diff line change 1
1
/// <reference types="jest-file-snapshot" />
2
2
3
- import {
4
- ImageConfig ,
5
- imageConfigDefault ,
6
- } from 'next/dist/next-server/server/image-config' ;
3
+ import { ImageConfig , imageConfigDefault } from 'next/dist/server/image-config' ;
7
4
import S3 from 'aws-sdk/clients/s3' ;
8
5
import * as path from 'path' ;
9
6
@@ -219,7 +216,7 @@ describe('unit', () => {
219
216
expect ( headers [ 'content-type' ] ) . toBe ( fixtureResponse [ 'content-type' ] ) ;
220
217
expect ( headers [ 'etag' ] ) . toBeDefined ( ) ;
221
218
expect ( headers [ 'cache-control' ] ) . toBe (
222
- 'public, max-age=0 , must-revalidate'
219
+ 'public, max-age=123456 , must-revalidate'
223
220
) ;
224
221
225
222
const optimizerPrefix = `external_accept_webp_w-${ optimizerParams . w } _q-${ optimizerParams . q } _` ;
Original file line number Diff line number Diff line change 1
1
import { fork } from 'child_process' ;
2
2
import getPort from 'get-port' ;
3
- import { ImageConfig } from 'next/dist/next-server/ server/image-config' ;
3
+ import { ImageConfig } from 'next/dist/server/image-config' ;
4
4
import fetch from 'node-fetch' ;
5
5
import { createRequest , createResponse } from 'node-mocks-http' ;
6
6
import { EventEmitter } from 'events' ;
You can’t perform that action at this time.
0 commit comments