0.1.2 • Published 9 years ago

laravel-elixir-base64 v0.1.2

Weekly downloads
3
License
GNU
Repository
github
Last release
9 years ago

Laravel Elixir Base64

A small helper to inline images as base64 for Laravel Elixir.

Installation & Setup

First, install laravel-elixir-base64 as a development dependency:

npm install --save-dev laravel-elixir-base64

Create a images folder in your assets folder resources/assets/images. The script will by default check in this folder for images that are enabled for base64 inlining in your css files.

Now you are ready for using it in your gulpfile.js, add a new mixin to it like following

elixir(function(mix) {
    mix.inlineBase64('app.css', 'compiled.css');
});

Configuration

This plugin offers a few configuration settings, that can be set as thirth argument The syntax is as following:

    mix.inlineBase64(Src, Filename, Options);
ArgumentDescription
SrcThe css file that needs optimizing, by default it will prefix the given filename with the elixir cssOutput directory what is by default `/public/css/
FilenameThe filename where the optimized sourcefile should be written to. By default this would be named optimized.css and also stored at the elixir cssOutput configuration setting.

The Options argument is optional and contains the following settings

ValueDefault
baseDirelixir.config.assetsDir + "images/" (resources/assets/)
maxSize14 * 1024
debugfalse