laravel-mix-edge
Laravel Mix Plugin for compiling Edge templates.
Introduction
This package provides a plugin for Laravel Mix to compile Edge templates. laravel-mix-edge
requires Laravel Mix to work. Please follow the instructions on how to use it on the package repository.
Usage
Install this package into your project:
npm install laravel-mix-edge --save-dev
Head over to your webpack.mix.js
and register it on the Laravel Mix API:
let mix = ;; mix ;
Options
You can also pass in a third optional parameter: options object. It accepts two options:
seeds
This is a path to a folder with seed files. Files can be of type json
or yaml
. They will be parsed and provided in your Edge template locals under the seed file name and then contents.
mix;
And if you have a file demo.yml
in there all the content will be available in your template under
<a href="{{ demo.anchor.link }}"> {{ demo.anchor.name }}</a>
locals
It's possible to pass in an object which will be added to locals in your Edge templates:
mix;
and in your edge file:
<link rel="stylesheet" href="{{ config.baseUrl }}css/main.css"><script src="{{ config.baseUrl }}js/main.js"></script>
outputExtension && sourceExtension
It is possible to change to output file and source file extension.
mix;
edge
It is possible to set options to Edge library.
mix;
global
Globals are key/value pairs available to all of your templates. Edge ships with a bunch of commonly used globals. Also, you can add your own globals to the edge instance. More info
mix;
presenters
View Presenter is a way to encapsulate complex logic inside a dedicated class, instead of writing it inside your template files. Also, it is very important to understand the philosophy behind a Presenter before you can really empower it. More info
mix;
License
Laravel Mix Edge is open-sourced software licensed under the MIT license.