/statamic-blend

Use Laravel Mix with Statamic in Blade templates like you already do with Laravel

Primary LanguagePHPMIT LicenseMIT

Blend for Statamic Statamic 2.11

Use Laravel Mix with Statamic in Blade templates like you already do with Laravel. It uses the Mix class from Laravel as a singleton with some Statamic adaptations for finding theme files. This Addon works with Blade templates only. If you're using Antlers, check out Statamic Mix.

Installation

Simply copy the Blend folder into site/addons/. That's it!

Usage

Just use it like you would normally use Mix with Laravel Blade templates:

<!DOCTYPE html>
<html>
    <head>
        <title>Statamic</title>
        <link rel="stylesheet" href="{{ mix('css/app.css') }}">
    </head>
    <body>
        <script src="{{ mix('js/app.js') }}"></script>
    </body>
</html>

You can also change your manifest directory just like you can with Laravel:

<link rel="stylesheet" href="{{ mix('css/app.css', 'public/build') }}">

Acknowledgements