laravel-elixir-base64
v0.1.2
Published
A small helper to inline images as base64 for Laravel Elixir
Downloads
14
Readme
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);
Argument | Description
-------- | -----------
Src | The css file that needs optimizing, by default it will prefix the given filename with the elixir cssOutput directory what is by default /public/css/
Filename | The 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
Value | Default ----- | ------- baseDir | elixir.config.assetsDir + "images/" (resources/assets/) maxSize | 14 * 1024 debug | false