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

Long term caching (vendor code splitting) #3850

Closed
rashidul0405 opened this issue Feb 20, 2018 · 2 comments
Closed

Long term caching (vendor code splitting) #3850

rashidul0405 opened this issue Feb 20, 2018 · 2 comments

Comments

@rashidul0405
Copy link
Contributor

rashidul0405 commented Feb 20, 2018

Feature Request

I'm not quite sure does this play well with next.js concepts. create-react-app repo contains lots of discussion on this topic.

[facebook/create-react-app#2206] It would be beneficial for splitting the js bundle into app and vendor files.
My app code keeps changing but vendor dependencies rarely change. splitting into two files will be a lot beneficial for long term caching.

If I decorate it as below will it plays well with next's automatic code splitting?

module.exports = {
  webpack(config, { prod }) {
    // pseudo code - modify CommonschunkPlugin behavior and return config.
    new webpack.optimize.CommonsChunkPlugin({
	    name: "vendor",
	    // filename: "vendor.js"
	    // (Give the chunk a different name)

	    minChunks: Infinity,
	    // (with more entries, this ensures that no other module
	    //  goes into the vendor chunk)
    })
    
  // return config
  }
}
@timneutkens
Copy link
Member

It might work, but we're going to address this for next v6

@ex3ndr
Copy link
Contributor

ex3ndr commented Jun 19, 2018

So, what's new in v6 about this?

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants