Skip to content

Commit cd3e26b

Browse files
committed
switch to using export default for loaders
1 parent 985fb0d commit cd3e26b

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
@@ -79,7 +79,7 @@ function wrapFunctions(userCode: string, templateCode: string, filepath: string)
7979
/**
8080
* Wrap `getStaticPaths`, `getStaticProps`, and `getServerSideProps` (if they exist) in the given page code
8181
*/
82-
function wrapDataFetchersLoader(this: LoaderThis<LoaderOptions>, userCode: string): string {
82+
export default function wrapDataFetchersLoader(this: LoaderThis<LoaderOptions>, userCode: string): string {
8383
// We know one or the other will be defined, depending on the version of webpack being used
8484
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8585
const { projectDir } = this.getOptions ? this.getOptions() : this.query!;
@@ -113,5 +113,3 @@ function wrapDataFetchersLoader(this: LoaderThis<LoaderOptions>, userCode: strin
113113
);
114114
return `${modifiedUserCode}\n${injectedCode}`;
115115
}
116-
117-
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)