1.0.1 • Published 2 years ago

laravel-mix-nunjucks-2 v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

laravel-mix-nunjucks-2

Laravel Mix extension to compile Nunjucks templates.

Install

npm install laravel-mix-nunjucks-2 --save-dev

Usage

const mix = require('laravel-mix');
require('laravel-mix-nunjucks-2');

mix.njk('resources/views/', {
  searchPath: '/',
  context: {
    foo: 'bar'
  }
});
  • searchPath - Search path for templates/partials
  • context - Data passed to template

Feature: Usage of a ready enviroment for sass, js and nunjucks with laravel-mix on it: webpack-nunjucks-boilerplate.

For more info about nunjucks, check https://mozilla.github.io/nunjucks/api.html