-
Notifications
You must be signed in to change notification settings - Fork 916
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
Run optimized dependency install after build #526
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/snowpack/q1me3z3dy |
15e9692
to
56c13c2
Compare
33a3699
to
b1210da
Compare
56c13c2
to
8bb7b65
Compare
b1210da
to
3556542
Compare
3556542
to
d073aef
Compare
8bb7b65
to
966fbb7
Compare
d073aef
to
3eadfb0
Compare
); | ||
// 3. Print stats immediate after install output. | ||
if (installResult.stats) { | ||
console.log(printStats(installResult.stats)); |
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.
Could this printStats()
live in the install runner? Or are there times when we don’t want the install command to write to stdout?
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.
Yup, this is in preparation for some of the work happening in #523, and a time when we'll be able to configure install()
to not write to stdout/stderr, if you want to call it programatically.
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.
This makes sense to me! I had some minor questions / comments but nothing blocking.
3416bf5
to
49b2e2c
Compare
49b2e2c
to
dd35333
Compare
Resolves #475, based on #525
This PR solves all of the tree-shaking issues we've seen since adding it back into Snowpack, mainly around
import {TSType}
and some of the more custom compile-to-JS languages like Svelte & Vue where the compiler adds imports that our current source code scanner never sees.This replaces our current build workflow:
With a new, more explicit workflow:
As a happy bonus, running install as a part of the build means that its output isn't immediately hidden by the first paint of dashboard. Install logs now show up in the Console portion of the dashboard. As a follow-up, we should make this its own section (
▼ Install Optimized Dependencies
).Somewhat related: this feels like the final nail in the coffin for representing "where will we install web_modules?" inside of a "mount" script. Now that we have replaced our old "install-then-copy" with an "install directly into build dir", "mounting" this already-fake directory makes even less sense. I think it's time to treat "web_modules" as the special concept that it is, and give it its own "buildOptions.webModulesPath" configuration.