2017 © Pedro Peláez
 

craft-plugin craft3-mix

Helper plugin for rev-manifest in Craft templates

image

venveo/craft3-mix

Helper plugin for rev-manifest in Craft templates

  • Saturday, July 15, 2017
  • by ransom
  • Repository
  • 1 Watchers
  • 2 Stars
  • 319 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 22 % Grown

The README.md

Use Laravel Mix (or any rev-manifest) with Craft CMS

You can already use Laravel Mix (Formerly Elixir) with Craft. It's rather straight forward. In fact, Matt Stauffer has an excellent write up on using Elixir on his company blog., (*1)

However, when using a CDN such as CloudFlare or Fastly. You might want to take advantage of file versioning to bust the cache. This plugin lets you use Elixir's built in versioning in your Craft templates!, (*2)

Don't use Mix?

That's okay! The rev-manifest format is standard and this plugin is build-process agnostic. Just make sure your paths are configured properly., (*3)

Requirements

  • Craft 3 (Tested on Beta 10)
  • Composer

Looking for a Craft 2 solution? Check out our Laravel Elixir package for Craft 2, (*4)

Installation and Setup

Please follow the installation guide for Craft 3 plugins here, (*5)

Usage

Twig Function, (*6)

{{ mix('css/all.css') }}

Note: you can optionally output the entire HTML tag by passing a second argument true to the function (e.g {{ elixir('css/all.css', true) }}., (*7)

Twig Filter, (*8)

{{ 'css/all.css' | mix }}

<link rel="stylesheet" href="{{ craft.mix.version('css/all.css') }}">, (*9)

and, (*10)

<script src="{{ craft.mix.version('js/app.js') }}"></script>, (*11)

If you are especially lazy, you can have the plugin automatically create the entire tag, based on the file extension., (*12)

{{ craft.mix.withTag('js/app.js') | raw }}, (*13)

This will output the <script> or <link> tags appropriately., (*14)

Credits

About Venveo

Venveo is a Digital Marketing Agency for Building Materials Companies in Blacksburg, VA. Learn more about us on our website., (*15)

License

The MIT License (MIT). Please see License File for more information., (*16)

The Versions

15/07 2017

dev-master

9999999-dev

Helper plugin for rev-manifest in Craft templates

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft mix

10/07 2017

1.0.3

1.0.3.0

Helper plugin for rev-manifest in Craft templates

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft mix

10/07 2017

1.0.2

1.0.2.0

Helper plugin for rev-manifest in Craft templates

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft mix

10/07 2017

1.0.1

1.0.1.0

Helper plugin for rev-manifest in Craft templates

  Sources   Download

MIT

The Requires

 

cms craftcms craft-plugin craft mix

09/05 2017

1.0.0

1.0.0.0

Helper plugin for rev-manifest in Craft templates

  Sources   Download

MIT

The Requires

 

by Jason McCallister

cms craftcms craft-plugin craft mix