Skip to content

Commit

Permalink
update checking for isSrcDir
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 2, 2022
1 parent 4fee739 commit 1034a5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/next/build/index.ts
Expand Up @@ -314,9 +314,9 @@ export default async function build(
eventCliSession(dir, config, {
webpackVersion: 5,
cliCommand: 'build',
isSrcDir: pagesDir
? path.relative(dir, pagesDir).startsWith('src')
: false,
isSrcDir:
(!!pagesDir && path.relative(dir, pagesDir).startsWith('src')) ||
(!!appDir && path.relative(dir, appDir).startsWith('src')),
hasNowJson: !!(await findUp('now.json', { cwd: dir })),
isCustomServer: null,
})
Expand Down
7 changes: 4 additions & 3 deletions packages/next/server/dev/next-dev-server.ts
Expand Up @@ -686,9 +686,10 @@ export default class DevServer extends Server {
eventCliSession(this.distDir, this.nextConfig, {
webpackVersion: 5,
cliCommand: 'dev',
isSrcDir: this.pagesDir
? relative(this.dir, this.pagesDir).startsWith('src')
: false,
isSrcDir:
(!!this.pagesDir &&
relative(this.dir, this.pagesDir).startsWith('src')) ||
(!!this.appDir && relative(this.dir, this.appDir).startsWith('src')),
hasNowJson: !!(await findUp('now.json', { cwd: this.dir })),
isCustomServer: this.isCustomServer,
})
Expand Down

0 comments on commit 1034a5b

Please sign in to comment.