question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
LekoArtscommented, Jul 18, 2018

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

0reactions
AdityaAnand1commented, Sep 2, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I bundle multiple javascript files into a single output file?
I have a folder containing 15 third-party js files (either jQuery plugins or javascript libaries) that I would like to bundle into a...
Read more >
How to bundle mutiple JS and CSS files into single bundle
I want to bundle into one bundle home.bundle.js and it should ... Replace with gulp and gulp-concat if you need more than just...
Read more >
How do you 'merge' several JS files into one? [closed]
Use a javascript bundler to combine many smaller scripts into a custom file per page. This is more complicated, but allows you to...
Read more >
API - ESBuild
To join a set of files together with esbuild, import them all into a single entry point file and bundle just that one...
Read more >
How to combine Javascript files in Magento 2 - Mirasvit
The simplest way to combine all your Javascript files is merging. This technique just concatenates all of them to the one large file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found