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.