Skip to content

Commit 0ec7960

Browse files
author
Luca Forstner
committed
Rename proxyLoader to wrappingLoader
1 parent 89f5e79 commit 0ec7960

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export { default as valueInjectionLoader } from './valueInjectionLoader';
22
export { default as prefixLoader } from './prefixLoader';
3-
export { default as proxyLoader } from './proxyLoader';
3+
export { default as wrappingLoader } from './wrappingLoader';

packages/nextjs/src/config/loaders/proxyLoader.ts renamed to packages/nextjs/src/config/loaders/wrappingLoader.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ type LoaderOptions = {
2121
};
2222

2323
/**
24-
* Replace the loaded file with a proxy module "wrapping" the original file. In the proxy, the original file is loaded,
25-
* any data-fetching functions (`getInitialProps`, `getStaticProps`, and `getServerSideProps`) it contains are wrapped,
26-
* and then everything is re-exported.
24+
* Replace the loaded file with a wrapped version the original file. In the wrapped version, the original file is loaded,
25+
* any data-fetching functions (`getInitialProps`, `getStaticProps`, and `getServerSideProps`) or API routes it contains
26+
* are wrapped, and then everything is re-exported.
2727
*/
28-
export default async function proxyLoader(this: LoaderThis<LoaderOptions>, userCode: string): Promise<string> {
28+
export default async function wrappingLoader(this: LoaderThis<LoaderOptions>, userCode: string): Promise<string> {
2929
// We know one or the other will be defined, depending on the version of webpack being used
3030
const {
3131
pagesDir,

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function constructWebpackConfigFunction(
9898
test: new RegExp(`^${escapeStringForRegex(pagesDir)}.*\\.(${pageExtensionRegex})$`),
9999
use: [
100100
{
101-
loader: path.resolve(__dirname, 'loaders/proxyLoader.js'),
101+
loader: path.resolve(__dirname, 'loaders/wrappingLoader.js'),
102102
options: {
103103
pagesDir,
104104
pageExtensionRegex,

0 commit comments

Comments
 (0)