laravel-elixir-html-minify

1.0.1 • Public • Published

Laravel Elixir HTML minify

This package allows you to minify static html files. This is useful when you are using static partials loaded through ajax, for example on an angular application.

Installation

First you need to install this package.

npm install --save-dev laravel-elixir-html-minify

Then require this package into your gulpfile.js.

var Elixir = require('laravel-elixir');
require('laravel-elixir-html-minify');

Then call the html method from your mix.

The html method can take up to four arguments:

  1. src (required): The files to minify.
  2. outputPath (optional): The output folder (defaults to public/html).
  3. baseDir (optional): The folder in which your html files are stored (defaults to resources/assets/html).
  4. options (optional): Options object passed to the gulp-html-minify task.

This task defines a watcher for the path defined in src.

Sample code:

Elixir(function(mix) {
    mix.html('**/*.html', 'public/html', 'resources/assets/html', {quotes: true, loose: true, empty: true});
});

Package Sidebar

Install

npm i laravel-elixir-html-minify

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • ruysu