Skip to content

Commit f471882

Browse files
author
Emod Kovacs
committed
chore: update pagesDirs option in new changes
1 parent 25ad574 commit f471882

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

packages/next/build/babel/plugins/react-loadable-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export default function ({
152152
'+',
153153
t.stringLiteral(
154154
relativePath(
155-
state.file.opts.caller.pagesDir,
155+
state.file.opts.caller.pagesDirs[0],
156156
state.file.opts.filename
157157
) + ' -> '
158158
),

packages/next/build/webpack-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ export default async function getBaseWebpackConfig(
11321132
!isServer &&
11331133
new ReactLoadablePlugin({
11341134
filename: REACT_LOADABLE_MANIFEST,
1135-
pagesDir,
1135+
pagesDirs,
11361136
}),
11371137
!isServer && new DropClientPage(),
11381138
// Moment.js is an extremely popular library that bundles large locale files

packages/next/build/webpack/plugins/react-loadable-plugin.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function getChunkGroupFromBlock(
7373
function buildManifest(
7474
_compiler: webpack.Compiler,
7575
compilation: webpack.compilation.Compilation,
76-
pagesDir: string
76+
pagesDirs: string[]
7777
) {
7878
let manifest: { [k: string]: { id: string | number; files: string[] } } = {}
7979

@@ -105,7 +105,7 @@ function buildManifest(
105105
// We construct a "unique" key from origin module and request
106106
// It's not perfect unique, but that will be fine for us.
107107
// We also need to construct the same in the babel plugin.
108-
const key = `${path.relative(pagesDir, originRequest)} -> ${
108+
const key = `${path.relative(pagesDirs[0], originRequest)} -> ${
109109
dependency.request
110110
}`
111111

@@ -164,15 +164,15 @@ function buildManifest(
164164

165165
export class ReactLoadablePlugin {
166166
private filename: string
167-
private pagesDir: string
167+
private pagesDirs: string[]
168168

169-
constructor(opts: { filename: string; pagesDir: string }) {
169+
constructor(opts: { filename: string; pagesDirs: string[] }) {
170170
this.filename = opts.filename
171-
this.pagesDir = opts.pagesDir
171+
this.pagesDirs = opts.pagesDirs
172172
}
173173

174174
createAssets(compiler: any, compilation: any, assets: any) {
175-
const manifest = buildManifest(compiler, compilation, this.pagesDir)
175+
const manifest = buildManifest(compiler, compilation, this.pagesDirs)
176176
// @ts-ignore: TODO: remove when webpack 5 is stable
177177
assets[this.filename] = new sources.RawSource(
178178
JSON.stringify(manifest, null, 2)

packages/next/server/hot-reloader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ export default class HotReloader {
311311
isServer: false,
312312
config: this.config,
313313
buildId: this.buildId,
314-
pagesDir: this.pagesDir,
314+
pagesDirs: this.pagesDirs,
315315
rewrites: {
316316
beforeFiles: [],
317317
afterFiles: [],

0 commit comments

Comments
 (0)