Skip to content

Commit 729dfff

Browse files
committed
add config to BuildContext type and corresponding mock data
1 parent cffcefa commit 729dfff

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/nextjs/src/config/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ export type WebpackConfigObject = {
4343
};
4444

4545
// Information about the current build environment
46-
export type BuildContext = { dev: boolean; isServer: boolean; buildId: string; dir: string };
46+
export type BuildContext = {
47+
dev: boolean;
48+
isServer: boolean;
49+
buildId: string;
50+
dir: string;
51+
config: Partial<NextConfigObject>;
52+
};
4753

4854
/**
4955
* Webpack `entry` config

packages/nextjs/test/config.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ const clientWebpackConfig = {
8080
target: 'web',
8181
context: '/Users/Maisey/projects/squirrelChasingSimulator',
8282
};
83+
8384
const baseBuildContext = {
8485
dev: false,
8586
buildId: 'doGsaREgReaT',
8687
dir: '/Users/Maisey/projects/squirrelChasingSimulator',
88+
config: { target: 'server' as const },
8789
};
8890
const serverBuildContext = { isServer: true, ...baseBuildContext };
8991
const clientBuildContext = { isServer: false, ...baseBuildContext };

0 commit comments

Comments
 (0)