New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add @next/vendored #64938
base: canary
Are you sure you want to change the base?
Add @next/vendored #64938
Conversation
FYI we've replaced taskr is being replaced with using Turborepo: #64825 |
Thanks for sharing it. Note that I replaced |
This PR aims to replace the use of
next/dist/compiled/*
with@next/vendored/*
.Motivation
next/src/compiled
from source. Currently Next.js clones its contents intonext/dist/compiled
but we can run the tasks that generate the modules fast enough with caching.next/dist/compiled/*
will now to go@next/vendored/*
, a separate package that has all the third party modules that were compiled by ncc. This allows Next.js to haveexports
insidepackage.json
in a future update, which is currently highly difficult due to it having inner node packages (i.e nested modules that are resolved after reading apackage.json
).next
repo.Status
Some things that have been done so far:
taskr
. The reason istaskr
doesn't work very well with ESM (The@taskr/esnext
package is a hack and it's still commonjs), because of this resolving a package always sends its commonjs distribution to ncc. There are also some differences in how the tasks are declared, particularly I wanted to have a way to generate multiple tasks with a loop for the most common cases.Todo
next
to@next/vendored
Testing locally
After running
pnpm install
, build@next/vendored
with:and then run the ncc tasks in
@next/vendored
:Run
pnpm dev
at the root and the Next.js build should work. I'm testing it locally in an app from create-next-app and withpnpm next-with-deps