Skip to content

Commit dbd8903

Browse files
committed
switch to using export default for loaders
1 parent 01a1f10 commit dbd8903

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/nextjs/src/config/loaders/dataFetchersLoader.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function wrapFunctions(userCode: string, templateCode: string, filepath: string)
9393
/**
9494
* Wrap `getStaticPaths`, `getStaticProps`, and `getServerSideProps` (if they exist) in the given page code
9595
*/
96-
function wrapDataFetchersLoader(this: LoaderThis<LoaderOptions>, userCode: string): string {
96+
export default function wrapDataFetchersLoader(this: LoaderThis<LoaderOptions>, userCode: string): string {
9797
// We know one or the other will be defined, depending on the version of webpack being used
9898
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9999
const { projectDir } = this.getOptions ? this.getOptions() : this.query!;
@@ -135,5 +135,3 @@ function wrapDataFetchersLoader(this: LoaderThis<LoaderOptions>, userCode: strin
135135

136136
return `${modifiedUserCode}\n${injectedCode}`;
137137
}
138-
139-
export { wrapDataFetchersLoader as default };

packages/nextjs/src/config/loaders/prefixLoader.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type LoaderOptions = {
1010
/**
1111
* Inject templated code into the beginning of a module.
1212
*/
13-
function prefixLoader(this: LoaderThis<LoaderOptions>, userCode: string): string {
13+
export default function prefixLoader(this: LoaderThis<LoaderOptions>, userCode: string): string {
1414
// We know one or the other will be defined, depending on the version of webpack being used
1515
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1616
const { distDir } = this.getOptions ? this.getOptions() : this.query!;
@@ -25,5 +25,3 @@ function prefixLoader(this: LoaderThis<LoaderOptions>, userCode: string): string
2525

2626
return `${templateCode}\n${userCode}`;
2727
}
28-
29-
export { prefixLoader as default };

0 commit comments

Comments
 (0)