Skip to content

Build Script for js bundle #31

Open

Description

@varffs

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

Activity

  1. samthetechie commented on Nov 15, 2012

    @samthetechie
    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.

  2. samthetechie commented on Nov 15, 2012

    @samthetechie
    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.

  3. Gaffen commented on Dec 7, 2012

    @Gaffen
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions