Skip to content

Commit

Permalink
provide correct rootPath
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jul 24, 2023
1 parent cf1162d commit 7f281e5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/next/src/cli/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,16 @@ const nextDev: CliCommand = async (argv) => {

// Just testing code here:

const project = await bindings.turbo.createProject({
const options = {
projectPath: dir,
rootPath: dir,
rootPath: args['--root'] ?? findRootDir(dir) ?? dir,
nextConfig: config,
env: {
NEXT_PUBLIC_ENV_VAR: 'world',
},
watch: true,
})
}
const project = await bindings.turbo.createProject(options)
const iter = project.entrypointsSubscribe()

try {
Expand Down Expand Up @@ -295,13 +296,10 @@ const nextDev: CliCommand = async (argv) => {
}
Log.info('iteration done')
await project.update({
projectPath: dir,
rootPath: dir,
nextConfig: config,
...options,
env: {
NEXT_PUBLIC_ENV_VAR: 'hello',
},
watch: true,
})
}
} catch (e) {
Expand Down

0 comments on commit 7f281e5

Please sign in to comment.