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

Build Script for js bundle #31

Open
varffs opened this issue Nov 15, 2012 · 3 comments
Open

Build Script for js bundle #31

varffs opened this issue Nov 15, 2012 · 3 comments

Comments

@varffs
Copy link
Contributor

varffs commented Nov 15, 2012

It would be great to have a build script that pulled all js files from a folder into one file called main.js and then edited the links in the html head

@samthetechie
Copy link
Member

process: git pull code source to production server. python script to concatenate / merge the separate js files into main.js thereby reducing the number of GET requests needed for the webapp to function.

@samthetechie
Copy link
Member

We need some citations / references on why the "one file" approach is faster. Also need to discuss pros and cons and link to research / data.

@Gaffen
Copy link
Contributor

Gaffen commented Dec 7, 2012

If you check google pagespeed you'll see that they generally say better performing websites perform as few http requests as possible. As long as the difference in file size isn't insanely different it's generally better to have everything in one file.

Another plus is that all your javascript functions are downloaded and cached on page load, meaning no extra information to download on internal pages. Taking an OOP approach would be best where you have something like the following:

window.Sukey.init('page_name')

Which then runs all global javascripts, plus any extra ones on a per-page basis.

I'd advise a slightly more planned approach to this then just concatenating them if possible - it wil probably yield better performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants