Skip to content
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

Reduce CLI init install size #1272

Merged
merged 8 commits into from
Sep 6, 2023
Merged

Reduce CLI init install size #1272

merged 8 commits into from
Sep 6, 2023

Conversation

frandiox
Copy link
Contributor

NPM >= 7 installs peerDependencies by default except if they are marked as optional (according to this). Since we don't need certain dependencies in the init command and they are already included in the templates, we can stop installing them at the beginning when npm create @shopify/hydrogen is called, and install them in the background later together with all the other app deps.

@remix-run/dev alone is ~119MB so this should hopefully speed up installation times.

The best way to test this will be when it's merged by using npm create @shopify/hydrogen@next. However, you can also test locally by renaming node_modules/@remix-run/dev to a different name and running h2 init (or other commands to see the error).

Copy link
Contributor

@wizardlyhel wizardlyhel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@frandiox frandiox merged commit 291115d into main Sep 6, 2023
@frandiox frandiox deleted the fd-reduce-cli-install-size branch September 6, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants