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(
6262 includeCache : config . dangerous ?. enableCacheInterception ,
6363 additionalExternals : config . edgeExternals ,
6464 onlyBuildOnce : forceOnlyBuildOnce === true ,
65+ name : "middleware" ,
6566 } ) ;
6667
6768 installDependencies ( outputPath , config . middleware ?. install ) ;
@@ -76,6 +77,7 @@ export async function createMiddleware(
7677 middlewareInfo,
7778 options,
7879 onlyBuildOnce : true ,
80+ name : "middleware" ,
7981 } ) ;
8082 }
8183}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ interface BuildEdgeBundleOptions {
2929 includeCache ?: boolean ;
3030 additionalExternals ?: string [ ] ;
3131 onlyBuildOnce ?: boolean ;
32+ name : string ;
3233}
3334
3435export async function buildEdgeBundle ( {
@@ -42,6 +43,7 @@ export async function buildEdgeBundle({
4243 includeCache,
4344 additionalExternals,
4445 onlyBuildOnce,
46+ name,
4547} : BuildEdgeBundleOptions ) {
4648 const isInCloudfare =
4749 typeof overrides ?. wrapper === "string"
@@ -84,6 +86,7 @@ export async function buildEdgeBundle({
8486 }
8587 : { } ) ,
8688 } ,
89+ fnName : name ,
8790 } ) ,
8891 openNextReplacementPlugin ( {
8992 name : "externalMiddlewareOverrides" ,
@@ -222,5 +225,6 @@ export async function generateEdgeBundle(
222225 options,
223226 overrides : fnOptions . override ,
224227 additionalExternals : options . config . edgeExternals ,
228+ name,
225229 } ) ;
226230}
Original file line number Diff line number Diff line change 11import { readFileSync } from "node:fs" ;
22import path from "node:path" ;
33
4+ import chalk from "chalk" ;
45import type { Plugin } from "esbuild" ;
56import type { MiddlewareInfo } from "types/next-types.js" ;
67
@@ -14,6 +15,7 @@ import {
1415 loadPrerenderManifest ,
1516 loadRoutesManifest ,
1617} from "../adapters/config/util.js" ;
18+ import logger from "../logger.js" ;
1719
1820export interface IPluginSettings {
1921 nextDir : string ;
@@ -51,6 +53,7 @@ export function openNextEdgePlugins({
5153 return {
5254 name : "opennext-edge" ,
5355 setup ( build ) {
56+ logger . debug ( chalk . blue ( "OpenNext Edge plugin" ) ) ;
5457 if ( edgeFunctionHandlerPath ) {
5558 // If we bundle the routing, we need to resolve the middleware
5659 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({
6767 `\/\/#override (${ id } )\n([\\s\\S]*?)\/\/#endOverride` ,
6868 ) ;
6969 logger . debug (
70- chalk . blue ( `Open-next replacement plugin ${ name } ` ) ,
70+ chalk . blue ( `OpenNext Replacement plugin ${ name } ` ) ,
7171 ` -- Deleting override for ${ id } ` ,
7272 ) ;
7373 contents = contents . replace ( pattern , "" ) ;
Original file line number Diff line number Diff line change 11import { readFileSync } from "node:fs" ;
22
3+ import chalk from "chalk" ;
34import type { Plugin } from "esbuild" ;
45import type {
56 DefaultOverrideOptions ,
@@ -75,7 +76,10 @@ export function openNextResolvePlugin({
7576 return {
7677 name : "opennext-resolve" ,
7778 setup ( build ) {
78- logger . debug ( `OpenNext Resolve plugin for ${ fnName } ` ) ;
79+ logger . debug (
80+ chalk . blue ( "OpenNext Resolve plugin" ) ,
81+ fnName ? `for ${ fnName } ` : "" ,
82+ ) ;
7983 build . onLoad ( { filter : / c o r e ( \/ | \\ ) r e s o l v e \. j s / g } , async ( args ) => {
8084 let contents = readFileSync ( args . path , "utf-8" ) ;
8185 const overridesEntries = Object . entries ( overrides ?? { } ) ;
You can’t perform that action at this time.
0 commit comments