Skip to content

Commit

Permalink
fix(nextjs): fix invalid config warning by sanitizing it before passi…
Browse files Browse the repository at this point in the history
…ng to Next.js (#11313)
  • Loading branch information
jaysoo committed Jul 27, 2022
1 parent 1df151b commit 1fef99d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/next/plugins/with-nx.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// ignoring while we support both Next 11.1.0 and versions before it
// @ts-ignore
import type { NextConfig } from 'next/dist/server/config';
import type { NextConfig } from 'next';
import type { WebpackConfigOptions } from '../src/utils/types';

const { join } = require('path');
Expand All @@ -24,12 +22,13 @@ function regexEqual(x, y) {

function withNx(nextConfig = {} as WithNxOptions) {
const userWebpack = nextConfig.webpack || ((x) => x);
const { nx, ...validNextConfig } = nextConfig;
return {
eslint: {
ignoreDuringBuilds: true,
...(nextConfig.eslint ?? {}),
...(validNextConfig.eslint ?? {}),
},
...nextConfig,
...validNextConfig,
webpack: (config, options) => {
/*
* Update babel to support our monorepo setup.
Expand Down

0 comments on commit 1fef99d

Please sign in to comment.