-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
initial webpack externals support #7245
Conversation
Deploy preview for using-postcss-sass failed. Built with commit b936f3a https://app.netlify.com/sites/using-postcss-sass/deploys/5b717cc33813f026e858f60d |
Deploy preview for using-jss failed. Built with commit 45d3f6a https://app.netlify.com/sites/using-jss/deploys/5b6ebf8f3813f05fa058f642 |
Deploy preview for using-drupal ready! Built with commit b936f3a |
Deploy preview for gatsbyjs failed. Built with commit b936f3a https://app.netlify.com/sites/gatsbyjs/deploys/5b717cc23813f026e858f601 |
Deploy preview for gatsbygram ready! Built with commit b936f3a |
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.
Looks great! Exciting!
.renderHTML({ | ||
htmlComponentRendererPath, | ||
paths: pageSegment, | ||
envVars: { |
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.
Add a comment mentioning these are just variables that we set internally and we don't need to set others as the child process will pick them up from the environment.
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.
Done
…et programatically in gatsby-cli
const externalList = [ | ||
/^lodash/, | ||
`react`, | ||
/^react-dom/, |
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.
Should this have lodash
and react-dom
as strings along with the regexes?
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.
oh wait. ignore me 🤦♂️
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.
lodash
is regexp because otherwise it wouldn't catch things like require(
lodash/merge`)
react-dom
could be changed to string if I would use "react-dom"
and "react-dom/server"
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.
When I use this with redux, 'develop/build html' fails because of lodash-es package
* master: (597 commits) Add a site(https://mojaave.com) to showcase list (gatsbyjs#7275) feat: create a doc for open source pair programming sessions (gatsbyjs#7266) [docs] Add video lesson to the StaticQuery docs (gatsbyjs#7249) [v2] docs - update page query docs (gatsbyjs#7285) [v2] docs "Styling" overview (gatsbyjs#7288) Remove delay (gatsbyjs#7273) add site (gatsbyjs#7291) Adding new site to the showcase. (gatsbyjs#7281) chore(release): Publish initial webpack externals support (gatsbyjs#7245) add missing package dependencies (gatsbyjs#7259) add: custom configuration overview (gatsbyjs#7231): tutorial part four updates (gatsbyjs#7240) [www] Fix showcase search, checkbox styles (gatsbyjs#7014) (gatsbyjs#6584): Restructure plugin overview and plugin authoring pages (gatsbyjs#7229) Use Hubspot form for email subscription (gatsbyjs#7233) Adding bootstrap CV starter (gatsbyjs#7207) Stub Articles and new names (gatsbyjs#7200) Improve readability of verbose logging code in wordpress source plugin (gatsbyjs#7146) Update hash link to scroll to right section of page (gatsbyjs#7161) ...
* initial webpack externals support * dont recreate env vars object for every segment * add comment that we only need to set process.env variables that are set programatically in gatsby-cli
This disables bundling some of the packages when creating bundle for rendering static HTML, which decrease time needed to build that bundle.
Here's some statistics - https://docs.google.com/spreadsheets/d/1kT7tyEmVtuev3fkyQPMMoymF1W5iEl6dv7TfA_TQz2M/edit?usp=sharing
Closes #5605