2017 © Pedro Peláez
 

library autominifier

Automatically Minify and Concatenate your JS and CSS files and libraries into single files for improved application performance.

image

makehappen/autominifier

Automatically Minify and Concatenate your JS and CSS files and libraries into single files for improved application performance.

  • Wednesday, June 21, 2017
  • by makehappen
  • Repository
  • 0 Watchers
  • 1 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

autominifier

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

Automatically Minify and Concatenate your JS and CSS files and libraries into single files for improved application performance., (*2)

Main features

  • Auto minify and concatenate js and css libraries into single .min files
  • Auto cache bust on changed versions
  • Auto detection of environment type

Other features

  • It just works, out of the box
  • Set it and forget it
  • No complex configurations
  • No Node.js required
  • No "watch" command required
  • No "--production" flag required
  • No configuration updates needed when adding new files
  • Auto detect already minified files
  • Customize destination folder and file names
  • Faster than Gulp or Grunt

Install

Via Composer, (*3)

``` bash $ composer require makehappen/autominifier, (*4)


## Basic Usage ``` php // minifier instance with default settings $minifier = new Makehappen\AutoMinifier\Minify(); // returns "/js/app.min.js" $minifier->js(); // returns "/css/app.min.css" $minifier->css();

Post install:, (*5)

  • Add env.json files to .gitignore, (*6)

  • Update environment in env.json to development ``` json { "environment": "development" }, (*7)


- Run minifier instance again to generate .min files ## Customized Usage Custom folders and .min files: ``` php // minifier instance with public path relative to package src folder path $minifier = new Makehappen\AutoMinifier\Minify(); $minifier->setPublicFolder('/../../../../public_html/'); // returns .min.js file path with custom destinations $minifier->js('/javascript', 'functions.min.js'); // returns .min.css file path path with custom destinations $minifier->js('/styles', 'style.min.css');

Custom list and order of files: config.json, (*8)

{
    "files": [
        "file-1.js",
        "folder2/file-2.js"
    ]
}

Implementation example in a Laravel project

Autominifier implementation example in a Laravel project View all Screenshots >>, (*9)

Conventions

  • By default, JavaScript files should live in the public /js folder or its sub-folders
  • By default, CSS files should live in the public /css folder or its sub-folders
  • Default concatenation order is alphabetical, folders first, followed by file names
  • Default relative path from vendor folder to public folder is expected to be ../public
  • Accepted extension files: .js, .css, .sass, .scss

Change log

Please see CHANGELOG for more information what has changed recently., (*10)

Testing

bash $ composer test, (*11)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*12)

Security

If you discover any security related issues, please email florin@after5.io instead of using the issue tracker., (*13)

Credits

License

The MIT License (MIT). Please see License File for more information., (*14)

The Versions

21/06 2017

dev-master

9999999-dev https://github.com/makehappen/minifier

Automatically Minify and Concatenate your JS and CSS files and libraries into single files for improved application performance.

  Sources   Download

MIT

The Requires

 

The Development Requires

grunt minify concatenate gulp makehappen autominifier

30/05 2017

1.0.1.x-dev

1.0.1.9999999-dev https://github.com/makehappen/minifier

Automatically Minify and Concatenate your JS and CSS files and libraries into single files for improved application performance.

  Sources   Download

MIT

The Requires

 

The Development Requires

grunt minify concatenate gulp makehappen autominifier

30/05 2017

1.0.1

1.0.1.0 https://github.com/makehappen/minifier

Automatically Minify and Concatenate your JS and CSS files and libraries into single files for improved application performance.

  Sources   Download

MIT

The Requires

 

The Development Requires

grunt minify concatenate gulp makehappen autominifier

30/05 2017

1.0.0

1.0.0.0 https://github.com/makehappen/minifier

Automatically Minify and Concatenate your JS and CSS files and libraries into single files for improved application performance.

  Sources   Download

MIT

The Requires

 

The Development Requires

grunt minify concatenate gulp makehappen autominifier