Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/joaopjt/laravel-mix-njk
- Owner: joaopjt
- License: apache-2.0
- Created: 2021-11-23T18:37:39.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-07T20:14:59.000Z (about 2 years ago)
- Last Synced: 2024-10-28T05:24:18.803Z (21 days ago)
- Language: JavaScript
- Size: 74.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 templateFor more info about Nunjucks API, check [https://mozilla.github.io/nunjucks/api.html](https://mozilla.github.io/nunjucks/api.html)