Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minify CSS and JS
#1
This has been discussed in a different thread already but is not yet announced as planned feature. I'd like to see an automated combination, minifying and gzipping of all CSS and JS files as described here:


(12-31-2012, 07:33 PM)faviouz Wrote: In general I think it would be a good idea to have a more unified assets manager (most PHP frameworks offer one anyway) that would also allow some sort of a build process, i.e. concatenate files together and minify/gzip them as much as possible. You would then have a single file for all your styles and another for all the JavaScript (i.e. less HTTP requests), which would be nice for deploying your site to users (as long as you don't go around editing styles and scripts too often).

Thanks!
My Company - I am Microsoft Certified in HTML5, CSS3 and JS
Reply
#2
Quote:In order to aid the process of compiling our SASS files and combining our JavaScript modules, we’re making use of the gulp.js build system. This system compiles our SASS stylesheets into CSS, saves them and then minifies then into “*.min.css” files for use in the main theme. It also combines all of the JavaScript files (including vendor scripts such as jQuery) and minifies them too, along with optimising all of the images used by the theme.
http://blog.mybb.com/2015/05/30/2-0-dev-post-3/
[Image: banner.png]
Reply
#3
CSS is already minified in 1.8 (though not combined).

The base theme for 2.0 is being developed with gulp.js as part of the workflow to minify and combine both CSS and JS, and to optimize any images. We will likely be expanding this to user themes and JS, though we have not yet designed the implementation or the way it will work yet.
Reply
#4
So this can be moved to planned features in this case (there is no thread about it in the 2.0 section yet, sorry I missed that blog post Stefan).
My Company - I am Microsoft Certified in HTML5, CSS3 and JS
Reply
#5
Hi,

Your feature suggestion has been accepted as a planned feature to be implemented in MyBB 2.0. Thanks for your contribution!
Reply
#6
what about combining the CSS in 1.8, instead of making many calls to small CSS files consuming server requests?

Can there be a function to to append all the CSS and output the CSS to single flat file or cache?
Reply
#7
Combining CSS into a single URL may hinder some caching. As an example, global.css is included in all pages, so its content would have to be downloaded (instead of using a cache) for each page type.

I would also like some configuration to not minimize CSS and JS while I am tweaking themes and plugins.
Reply
#8
It would be nice to have both JS and CSS in the backend as data entries.....like CSS cascading as is now.....the developers just need a function to pull them out of DB, cache them as index.css, forumdisplay.css and deliver the exact named file to the correct location Toungue

for instance:

Quote:global.css
Attached to all pages
bootstrap-fixes.css
Attached to all pages
css3.css
Attached to all pages

should all be in global.css

Quote:usercp.css
Attached to usercp.php, usercp2.php and private.php

each of these pages should have an extra css for page specific: usercp.php.css, usercp2.php.css, private.php.css


EDIT: you can pretty much use Global Templates
Used by all themes

as a JS repository
Reply
#9
MyBB 2.0 is completely different, talking about 1.8 here makes no sense...
[Image: banner.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)