1+ const fs = require ( 'fs' )
2+ const path = require ( 'path' )
3+ // this page is conditionally added when not testing
4+ // in webpack 4 mode since it's not supported for webpack 4
5+ const imagePageData = fs . readFileSync (
6+ path . join ( __dirname , './image.js' ) ,
7+ 'utf8'
8+ )
9+
110const clientGlobs = [
211 {
312 name : 'Client Bundles (main, webpack, commons)' ,
@@ -12,11 +21,11 @@ const clientGlobs = [
1221 } ,
1322 {
1423 name : 'Client Pages' ,
15- globs : [ '.next/static/* /pages/**/*' , '.next/static/css/**/*' ] ,
24+ globs : [ '.next/static/BUILD_ID /pages/**/*.js ' , '.next/static/css/**/*' ] ,
1625 } ,
1726 {
1827 name : 'Client Build Manifests' ,
19- globs : [ '.next/static/* /_buildManifest*' ] ,
28+ globs : [ '.next/static/BUILD_ID /_buildManifest*' ] ,
2029 } ,
2130 {
2231 name : 'Rendered Page Sizes' ,
@@ -26,19 +35,19 @@ const clientGlobs = [
2635
2736const renames = [
2837 {
29- srcGlob : '.next/static/* /pages' ,
38+ srcGlob : '.next/static/chunks /pages' ,
3039 dest : '.next/static/BUILD_ID/pages' ,
3140 } ,
3241 {
33- srcGlob : '.next/static/* /pages/**/*' ,
42+ srcGlob : '.next/static/BUILD_ID /pages/**/*.js ' ,
3443 removeHash : true ,
3544 } ,
3645 {
37- srcGlob : '.next/static/runtime/*' ,
46+ srcGlob : '.next/static/runtime/*.js ' ,
3847 removeHash : true ,
3948 } ,
4049 {
41- srcGlob : '.next/static/chunks/*' ,
50+ srcGlob : '.next/static/chunks/*.js ' ,
4251 removeHash : true ,
4352 } ,
4453 {
@@ -60,6 +69,10 @@ module.exports = {
6069 title : 'Default Build' ,
6170 diff : 'onOutputChange' ,
6271 diffConfigFiles : [
72+ {
73+ path : 'pages/image.js' ,
74+ content : imagePageData ,
75+ } ,
6376 {
6477 path : 'next.config.js' ,
6578 content : `
@@ -77,6 +90,10 @@ module.exports = {
7790 // renames to apply to make file names deterministic
7891 renames,
7992 configFiles : [
93+ {
94+ path : 'pages/image.js' ,
95+ content : imagePageData ,
96+ } ,
8097 {
8198 path : 'next.config.js' ,
8299 content : `
0 commit comments