File tree Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ export async function createMiddleware(
62
62
includeCache : config . dangerous ?. enableCacheInterception ,
63
63
additionalExternals : config . edgeExternals ,
64
64
onlyBuildOnce : forceOnlyBuildOnce === true ,
65
+ name : "middleware" ,
65
66
} ) ;
66
67
67
68
installDependencies ( outputPath , config . middleware ?. install ) ;
@@ -76,6 +77,7 @@ export async function createMiddleware(
76
77
middlewareInfo,
77
78
options,
78
79
onlyBuildOnce : true ,
80
+ name : "middleware" ,
79
81
} ) ;
80
82
}
81
83
}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ interface BuildEdgeBundleOptions {
29
29
includeCache ?: boolean ;
30
30
additionalExternals ?: string [ ] ;
31
31
onlyBuildOnce ?: boolean ;
32
+ name : string ;
32
33
}
33
34
34
35
export async function buildEdgeBundle ( {
@@ -42,6 +43,7 @@ export async function buildEdgeBundle({
42
43
includeCache,
43
44
additionalExternals,
44
45
onlyBuildOnce,
46
+ name,
45
47
} : BuildEdgeBundleOptions ) {
46
48
const isInCloudfare =
47
49
typeof overrides ?. wrapper === "string"
@@ -84,6 +86,7 @@ export async function buildEdgeBundle({
84
86
}
85
87
: { } ) ,
86
88
} ,
89
+ fnName : name ,
87
90
} ) ,
88
91
openNextReplacementPlugin ( {
89
92
name : "externalMiddlewareOverrides" ,
@@ -222,5 +225,6 @@ export async function generateEdgeBundle(
222
225
options,
223
226
overrides : fnOptions . override ,
224
227
additionalExternals : options . config . edgeExternals ,
228
+ name,
225
229
} ) ;
226
230
}
Original file line number Diff line number Diff line change 1
1
import { readFileSync } from "node:fs" ;
2
2
import path from "node:path" ;
3
3
4
+ import chalk from "chalk" ;
4
5
import type { Plugin } from "esbuild" ;
5
6
import type { MiddlewareInfo } from "types/next-types.js" ;
6
7
@@ -14,6 +15,7 @@ import {
14
15
loadPrerenderManifest ,
15
16
loadRoutesManifest ,
16
17
} from "../adapters/config/util.js" ;
18
+ import logger from "../logger.js" ;
17
19
18
20
export interface IPluginSettings {
19
21
nextDir : string ;
@@ -51,6 +53,7 @@ export function openNextEdgePlugins({
51
53
return {
52
54
name : "opennext-edge" ,
53
55
setup ( build ) {
56
+ logger . debug ( chalk . blue ( "OpenNext Edge plugin" ) ) ;
54
57
if ( edgeFunctionHandlerPath ) {
55
58
// If we bundle the routing, we need to resolve the middleware
56
59
build . onResolve ( { filter : / \. \/ m i d d l e w a r e .m j s / g } , ( ) => {
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export function openNextReplacementPlugin({
67
67
`\/\/#override (${ id } )\n([\\s\\S]*?)\/\/#endOverride` ,
68
68
) ;
69
69
logger . debug (
70
- chalk . blue ( `Open-next replacement plugin ${ name } ` ) ,
70
+ chalk . blue ( `OpenNext Replacement plugin ${ name } ` ) ,
71
71
` -- Deleting override for ${ id } ` ,
72
72
) ;
73
73
contents = contents . replace ( pattern , "" ) ;
Original file line number Diff line number Diff line change 1
1
import { readFileSync } from "node:fs" ;
2
2
3
+ import chalk from "chalk" ;
3
4
import type { Plugin } from "esbuild" ;
4
5
import type {
5
6
DefaultOverrideOptions ,
@@ -75,7 +76,10 @@ export function openNextResolvePlugin({
75
76
return {
76
77
name : "opennext-resolve" ,
77
78
setup ( build ) {
78
- logger . debug ( `OpenNext Resolve plugin for ${ fnName } ` ) ;
79
+ logger . debug (
80
+ chalk . blue ( "OpenNext Resolve plugin" ) ,
81
+ fnName ? `for ${ fnName } ` : "" ,
82
+ ) ;
79
83
build . onLoad ( { filter : / c o r e ( \/ | \\ ) r e s o l v e \. j s / g } , async ( args ) => {
80
84
let contents = readFileSync ( args . path , "utf-8" ) ;
81
85
const overridesEntries = Object . entries ( overrides ?? { } ) ;
You can’t perform that action at this time.
0 commit comments