Skip to content

Commit

Permalink
fix: eslint error/drop support to webpack v4
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Nov 14, 2023
1 parent 43bd247 commit 7e35e10
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/next/src/config/plugins/ModifySourcePlugin/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ interface LoaderOptions {
}

interface modifyModuleSourceLoader {
getOptions?: () => LoaderOptions;
getOptions: () => LoaderOptions;
}

// eslint-disable-next-line @typescript-eslint/no-redeclare
export default function modifyModuleSourceLoader(
this: modifyModuleSourceLoader,
source: string,
): string {
const options: LoaderOptions = this.getOptions
? this.getOptions()
: require('loader-utils-webpack-v4').getOptions(this); // eslint-disable-line global-require
const options: LoaderOptions = this.getOptions();

validate(schema, options, {
name: 'ModifySourcePlugin webpack loader',
Expand Down

0 comments on commit 7e35e10

Please sign in to comment.