Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joaopjt/laravel-mix-njk

A better option than laravel-mix-nunjucks
https://github.com/joaopjt/laravel-mix-njk

Last synced: 17 days ago
JSON representation

A better option than laravel-mix-nunjucks

Awesome Lists containing this project

README

        

# laravel-mix-njk

Laravel Mix extension to compile Nunjucks templates.

## Install

```bash
npm install laravel-mix-njk --save-dev
```

## Usage

```javascript
const mix = require('laravel-mix');
require('laravel-mix-njk');

mix.njk('resources/views/', {
searchPath: '/',
context: {
foo: 'bar'
}
});
```

* `searchPath` - Search path for templates/partials
* `context` - Nunjucks data passed to the template

For more info about Nunjucks API, check [https://mozilla.github.io/nunjucks/api.html](https://mozilla.github.io/nunjucks/api.html)