Skip to content

Commit

Permalink
fix(nextjs): specify return type in withNx plugin (#12486)
Browse files Browse the repository at this point in the history
  • Loading branch information
G07cha committed Oct 26, 2022
1 parent 00044f9 commit 94edbe9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions packages/next/plugins/with-nx.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NextConfigComplete } from 'next/dist/server/config-shared';
import { withNx } from './with-nx';

describe('withNx', () => {
Expand All @@ -10,6 +11,13 @@ describe('withNx', () => {
module: { rules: [{ oneOf: [] }] },
},
{
buildId: 'build-id',
config: config as NextConfigComplete,
dev: true,
dir: 'dir',
isServer: false,
totalPages: 0,
webpack: undefined,
defaultLoaders: {
babel: {
options: {},
Expand All @@ -35,6 +43,13 @@ describe('withNx', () => {
module: { rules: [{ oneOf: [] }] },
},
{
buildId: 'build-id',
config: config as NextConfigComplete,
dev: true,
dir: 'dir',
isServer: false,
totalPages: 0,
webpack: undefined,
defaultLoaders: {
babel: {
options: {},
Expand Down
2 changes: 1 addition & 1 deletion packages/next/plugins/with-nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getWithNxContext(): WithNxContext {
export function withNx(
nextConfig = {} as WithNxOptions,
context: WithNxContext = getWithNxContext()
) {
): NextConfig {
const userWebpack = nextConfig.webpack || ((x) => x);
const { nx, ...validNextConfig } = nextConfig;
return {
Expand Down

0 comments on commit 94edbe9

Please sign in to comment.