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' ;
52import { parse as parseUrl } from 'url' ;
63import {
74 APIGatewayProxyEventV2 ,
Original file line number Diff line number Diff line change 11import { 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' ;
66import nodeFetch , { RequestInfo , RequestInit } from 'node-fetch' ;
77import { UrlWithParsedQuery } from 'url' ;
88import S3 from 'aws-sdk/clients/s3' ;
Original file line number Diff line number Diff line change 1717 },
1818 "dependencies" : {
1919 "aws-sdk" : " *" ,
20- "next" : " 11.0.1 " ,
20+ "next" : " 11.1.0 " ,
2121 "node-fetch" : " 2.6.1"
2222 },
2323 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -15,7 +15,16 @@ async function main() {
1515 // Get all files from build dir
1616 const buildFiles = glob . sync ( '**/*.js' , { cwd : buildDir , absolute : true } ) ;
1717
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 ] , {
1928 base : workspaceRoot ,
2029 processCwd : process . cwd ( ) ,
2130 // aws-sdk is already provided in Lambda images
@@ -29,15 +38,6 @@ async function main() {
2938 'node_modules/next/node_modules/jest-worker/build/workers/threadChild.js'
3039 ) ;
3140
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-
4141 // Create zip file
4242 await new Promise ( ( resolve , reject ) => {
4343 const outputFile = fs . createWriteStream (
Original file line number Diff line number Diff line change 11/// <reference types="jest-file-snapshot" />
22
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' ;
74import S3 from 'aws-sdk/clients/s3' ;
85import * as path from 'path' ;
96
@@ -219,7 +216,7 @@ describe('unit', () => {
219216 expect ( headers [ 'content-type' ] ) . toBe ( fixtureResponse [ 'content-type' ] ) ;
220217 expect ( headers [ 'etag' ] ) . toBeDefined ( ) ;
221218 expect ( headers [ 'cache-control' ] ) . toBe (
222- 'public, max-age=0 , must-revalidate'
219+ 'public, max-age=123456 , must-revalidate'
223220 ) ;
224221
225222 const optimizerPrefix = `external_accept_webp_w-${ optimizerParams . w } _q-${ optimizerParams . q } _` ;
Original file line number Diff line number Diff line change 11import { fork } from 'child_process' ;
22import getPort from 'get-port' ;
3- import { ImageConfig } from 'next/dist/next-server/ server/image-config' ;
3+ import { ImageConfig } from 'next/dist/server/image-config' ;
44import fetch from 'node-fetch' ;
55import { createRequest , createResponse } from 'node-mocks-http' ;
66import { EventEmitter } from 'events' ;
You can’t perform that action at this time.
0 commit comments