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

Is there a way to merge all JS build files in only one bundle? #6548

Closed
guilhermeutzig opened this issue Jul 18, 2018 · 5 comments
Closed

Is there a way to merge all JS build files in only one bundle? #6548

guilhermeutzig opened this issue Jul 18, 2018 · 5 comments

Comments

@guilhermeutzig
Copy link

guilhermeutzig commented Jul 18, 2018

Hey guys, enjoying a lot my experience here with Gatsby, it's really nice!

There is something I want to know, when I run gatsby build, it generates a ton of files on public directory:

image

Is there a way to envolve all of this in a single bundle file?

Thanks!

@guilhermeutzig guilhermeutzig changed the title Is there a way to put all build files in only one bundle? Is there a way to merge all JS build files in only one bundle? Jul 18, 2018
@LekoArts
Copy link
Contributor

No, this is by design to enable code splitting and other optimizations which make Gatsby so fast.

@guilhermeutzig
Copy link
Author

guilhermeutzig commented Jul 18, 2018

@LekoArts Ok, thanks for your answer! Closing this issue.

@KyleAMathews
Copy link
Contributor

We did move js/css files into their own directory recently #6346

@adueck
Copy link

adueck commented May 27, 2019

It would be great if there was an option to bundle it all into one file, because right now offline support (with gatsby-plugin-offline is less than ideal because the individual route files only get cached/saved when a visitor visits them, and then when the app is updated they lose those again.

It would be so nice if there was an option to have one big bundle that a service worker could cache, and then you could automatically have a fully offline-available site.

I asked a question along those lines eariler here but there was no response, and it was automatically closed.

@Aditya94A
Copy link

I'm using gatsby as a single page application generator, so I only have one page.

In this case, having one file (and one request) instead of 4-5 would be the more performant route. Shouldn't be too hard to have an option/plugin that just appends the JS file and give this as an option.

cc @LekoArts

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

No branches or pull requests

5 participants