Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !8917

Suggestion to decrease filesizes

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/jamescostian/3.0.0-wip into 3.0.0-wip Jul 31, 2013
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 19

Created by: jamescostian

All of the files in the js dir start and end with the exact same lines of code. What I did is I moved the first line of code that they all start with into js/intro.js. Then I moved the last line of code that they all end with to js/outro.js. I also made a function called addToPrototype which does exactly what the name implies and switched out all of the .prototype things with that new function.

After telling Grunt what I did, I ran grunt test && grunt dist-js and saw the filesizes of the files in dist/js drop.

The filesizes didn't drop by much though; dist/bootstrap.min.js lost about .7kb. But, I think that this can be very good because it allows other things that are done over and over again to be put in js/intro.js or js/outro.js so that the minified files can be even smaller.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jamescostian/3.0.0-wip