Next.js Discord

Discord Forum

next dev

Unanswered
Kenspectacle posted this in #help-forum
Open in Discord
Hello, im really curious on how to find out the implementation behind next dev. How can I check out the source code when I run npm run dev? where can I find out what exactly is next dev?

beginner here :)

27 Replies

@B33fb0n3 you can find the whole source code, that will be executed here: https://github.com/vercel/next.js
I already did a local clone of that repo, but I couldn't exactly find where is the next dev run script
a good start on how to trace the exact point would be this: https://github.com/vercel/next.js/blob/canary/package.json#L14
any idea on how to find it? I have the project open currently
very interesting, I'll take a look there :)
so technically its something like a chain?
my app
-> next dev
  nextJS
  -> turbo run dev
    turbopack
      -> something else
im really new at this package.json runtool stuff
@Kenspectacle any idea on how to find it? I have the project open currently
yes, check the lines, that I sent. Then you'll see, that it's a turbo repo. So you know you need to look into the right repository. Then check the correct folder. And in the folder a few arguments withhin the dev script will be executed. So find the package.json that contains the dev script that will be executed. Trace back the arguments to know what they are doing and then check what dev executes and do the same process again
but why is it turbo though? I searched through the bundler file in next js and it says that there is an enum of turbopack/webpack/rspack
soooo it could have been any of the 3 right?
@B33fb0n3 yes 🙂
im guessing that this will get replaced dynamically by the choice you do in your next.config file?
@Kenspectacle soooo it could have been any of the 3 right?
technically all of them are right. Like you can use turbopack for your nextjs app or webpack or rspack maybe in the future react compiler as well
hmmmmm I couldn't find just turbo in github though, is this https://github.com/vercel/turborepo correct?
yes. Keep in mind: turborepo != turbopack
and if yes, why is it turbo run ... command and not like turborepo run ...? im guessing that there is some way you can connect the repo together using alias?
ohhhhh
@B33fb0n3 yes. Keep in mind: turborepo != turbopack
okay wrong assumption from me then :D
ohhh lol
funny that it happened a day ago xd
@Kenspectacle funny that it happened a day ago xd
nah more like 7 months ago ^^
@B33fb0n3 nah more like 7 months ago ^^
ahhh only saw the date not the month :')
no worries. But cool, that we reacted the same like "ohhh" xD
@Kenspectaclesolved?