-
Notifications
You must be signed in to change notification settings - Fork 160
New option to install packages #574
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
Conversation
🦋 Changeset detectedLatest commit: e6a8556 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
logger.info(`Installing dependencies for ${name}...`); | ||
// We then need to run install in the tempDir | ||
// We don't install in the output dir directly because it could contain a package.json, and npm would then try to reinstall not complete deps from tracing the files | ||
const installCommand = `npm install --arch=${installOptions.arch ?? "arm64"} --platform=linux --target=${installOptions.nodeVersion ?? "18"} --libc=${installOptions.libc ?? "glibc"} ${installOptions.packages.join(" ")}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to use whatever packager was used for Next as it has been retrieved anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but we'll need to figure out how to pass all these options.
I don't think they support all of them, or there is no docs. If some other package manager support it we could use them and fallback to npm when not possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could pass the buildOptions
and the function name to installDeps
.
It would mean adding the outputPath
and the packager there.
But that's probably a nice to have for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about using buildOptions
and name
, but i think it would just overcomplicate things.
It could be a splitted functions (which are under functions in the config) and server functions are inside a different folder than the rest.
We could still pass buildOptions
to get the packager
Co-authored-by: Victor Berchet <[email protected]>
This PR fix #571
How to use
In any of the function in
open-next.config.ts
you can now add a new option that will install dependencies that may not be included (For example sharp):Install itself is optional, and everything in it is optional besides packages