Skip to content

Commit 41f6348

Browse files
committed
move prefix loader files into separate directories
1 parent 6ea53ed commit 41f6348

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/nextjs/rollup.npm.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export default [
1414
),
1515
...makeNPMConfigVariants(
1616
makeBaseNPMConfig({
17-
entrypoints: ['src/config/prefixLoaderTemplate.ts'],
17+
entrypoints: ['src/config/templates/prefixLoaderTemplate.ts'],
1818

1919
packageSpecificConfig: {
2020
output: {
2121
// preserve the original file structure (i.e., so that everything is still relative to `src`)
22-
entryFileNames: 'config/[name].js',
22+
entryFileNames: 'config/templates/[name].js',
2323

2424
// this is going to be add-on code, so it doesn't need the trappings of a full module (and in fact actively
2525
// shouldn't have them, lest they muck with the module to which we're adding it)
@@ -31,15 +31,15 @@ export default [
3131
),
3232
...makeNPMConfigVariants(
3333
makeBaseNPMConfig({
34-
entrypoints: ['src/config/prefixLoader.ts'],
34+
entrypoints: ['src/config/loaders/prefixLoader.ts'],
3535

3636
packageSpecificConfig: {
3737
output: {
3838
// make it so Rollup calms down about the fact that we're doing `export { loader as default }`
3939
exports: 'default',
4040

4141
// preserve the original file structure (i.e., so that everything is still relative to `src`)
42-
entryFileNames: 'config/[name].js',
42+
entryFileNames: 'config/loaders/[name].js',
4343
},
4444
},
4545
}),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function prefixLoader(this: LoaderThis, userCode: string): string {
2121
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2222
const { distDir } = this.getOptions ? this.getOptions() : this.query!;
2323

24-
const templatePath = path.resolve(__dirname, 'prefixLoaderTemplate.js');
24+
const templatePath = path.resolve(__dirname, '../templates/prefixLoaderTemplate.js');
2525
this.addDependency(templatePath);
2626

2727
// Fill in the placeholder

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function constructWebpackConfigFunction(
6565
// Support non-default output directories by making the output path (easy to get here at build-time)
6666
// available to the server SDK's default `RewriteFrames` instance (which needs it at runtime), by
6767
// injecting code to attach it to `global`.
68-
loader: path.resolve(__dirname, 'prefixLoader.js'),
68+
loader: path.resolve(__dirname, 'loaders/prefixLoader.js'),
6969
options: {
7070
distDir: userNextConfig.distDir || '.next',
7171
},

0 commit comments

Comments
 (0)