0.0.5 • Published 8 years ago

laravel-elixir-templates v0.0.5

Weekly downloads
17
License
-
Repository
github
Last release
8 years ago

laravel-elixir-templates

Elixir Templates

Plugin for laravel elixir to pack html templates into js file Currently support hadnlebars templates. If you need support for other templates fill free to ask me to extend plugin https://github.com/kalanjdjordje/laravel-elixir-templates/labels/question.

Install

$ npm install laravel-elixir-templates --save-dev

Usage Handlebars

Example gulpfile.js

var elixir = require( 'laravel-elixir' );

require( 'laravel-elixir-templates' );

elixir( function( mix )
{
  mix.templates('assets/templates/**/*.html', 'js/templates.js', { engine: "handlebars" });
});

Advanced Example gulpfile.js

var elixir = require( 'laravel-elixir' );

require( 'laravel-elixir-templates' );

elixir( function( mix )
{
  mix.templates('assets/templates/**/*.html', 'js/templates.js', { 
    // - Optional
    // - Default = handlebars
    //engine: "handlebars",
    
    // - Optional
    // - This option is for defining namespace
    // - default (for handlebars is 'App.templates')
    //namespace: "App.templates",
    
    // - Optional
    // - Regex wich will mach partial files
    //partialRegex: new RegExp(""),

    // - Optional
    // - this option allow you to transform your filename. If you don't like to your template name be same as filename
    //filenameConvert: function(filename, isPartial) { return filename;};

    // - Optional
    // - if is true all provided files from input will treat as partial. In that case partialRegex will be ignored
    //onlyPartials: true | false

    // - Optional
    // - if is true all provided files from input will treat as not partial. In that case partialRegex will be ignored
    //onlyNoPartials: true | false

  });
});

License

MIT

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago