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

Do not hardcode vendor bundles in webpack #1280

Merged
merged 1 commit into from Jul 4, 2017
Merged

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Jun 27, 2017

No description provided.

@xPaw xPaw added the Type: Feature Tickets that describe a desired feature or PRs that add them to the project. label Jun 27, 2017
@xPaw xPaw added this to the 2.3.3 milestone Jun 27, 2017
@astorije astorije changed the title Do not hardcoded vendor bundles in webpack Do not hardcode vendor bundles in webpack Jun 27, 2017
// automatically split all vendor dependancies into a separate bundle
new webpack.optimize.CommonsChunkPlugin({
name: "js/bundle.vendor.js",
minChunks: (module) => module.context && module.context.indexOf("node_modules") !== -1
Copy link
Member

Choose a reason for hiding this comment

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

How does this know what packages to build into the vendor bundle specifically?

Copy link
Member Author

Choose a reason for hiding this comment

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

node_modules being in the path.

Copy link
Member

Choose a reason for hiding this comment

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

Right, that tells Webpack where are our packages, but is it going to load everything that's under node_modules (like lodash, that we don't use in the client)? Or is it the other way around, it discovers everything that's require()d, then puts them in the right file based on this line?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's based on requires. Basically it generates identical bundles to what master has now.

@astorije astorije merged commit 17978af into master Jul 4, 2017
@astorije astorije deleted the xpaw/simple-vendor branch July 4, 2017 05:43
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Do not hardcode vendor bundles in webpack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants