2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-minifier

CSS & JavaScript minifier, in PHP for SilverStripe 4 integrating matthiasmullie/minify

image

axllent/silverstripe-minifier

CSS & JavaScript minifier, in PHP for SilverStripe 4 integrating matthiasmullie/minify

  • Tuesday, February 6, 2018
  • by axllent
  • Repository
  • 1 Watchers
  • 2 Stars
  • 223 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 94 % Grown

The README.md

CSS & JavaScript minifier for Silverstripe

Automatically minify combined CSS & JavaScript files in Silverstripe 5 when running Requirements::process_combined_files(). Internally it uses matthiasmullie/minify to remove whitespace, strips comments and combines files., (*1)

This is useful if you do not require any JavaScript bundling or transpiling (eg: webpak, esbuild etc) but you still wish to minify the combined CSS and JavaScript files., (*2)

Requirements

  • Silverstripe ^5

Installation

composer require axllent/silverstripe-minifier

This module is plug-and-play, no configuration required after installing and running a ?flush., (*3)

Usage example

<?php

use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\View\Requirements;

class PageController extends ContentController
{
    /**
     * Init function
     *
     * @return void
     */
    protected function init()
    {
        parent::init();

        $css[] = 'themes/site/css/file1.css';
        $css[] = 'themes/site/css/file2.css';
        $css[] = 'themes/site/css/file3.css';
        Requirements::combine_files('combined.css', $css);
        Requirements::process_combined_files();

        $js[] = 'themes/site/js/file1.js';
        $js[] = 'themes/site/js/file2.js';
        $js[] = 'themes/site/js/file3.js';
        Requirements::combine_files('combined.js', $js);
        Requirements::process_combined_files();
    }
}

The Versions

06/02 2018

dev-master

9999999-dev https://github.com/axllent/silverstripe-minifier

CSS & JavaScript minifier, in PHP for SilverStripe 4 integrating matthiasmullie/minify

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

css javascript silverstripe minify

16/10 2017

1.0.1

1.0.1.0 https://github.com/axllent/silverstripe-minifier

CSS & JavaScript minifier, in PHP for SilverStripe 4 integrating matthiasmullie/minify

  Sources   Download

The MIT License (MIT)

The Requires

 

css javascript silverstripe minify

16/10 2017

dev-vendormodule

dev-vendormodule https://github.com/axllent/silverstripe-minifier

CSS & JavaScript minifier, in PHP for SilverStripe 4 integrating matthiasmullie/minify

  Sources   Download

The MIT License (MIT)

The Requires

 

css javascript silverstripe minify

10/10 2017

1.0.0

1.0.0.0 https://github.com/axllent/silverstripe-minifier

CSS & JavaScript minifier, in PHP for SilverStripe 4 integrating matthiasmullie/minify

  Sources   Download

The MIT License (MIT)

The Requires

 

css javascript silverstripe minify