Use Nunjucks in the browser
masterYou can include Nunjucks in the browser using a script tag or as an AMD module.
Choosing a build
- nunjucks.js: The full library (approx. 20K min/gzipped). Includes the full compiler, allowing you to dynamically load and compile templates on the fly. Recommended for development or if file size is not a priority.
- nunjucks-slim.js: The slim version (approx. 8K min/gzipped). Does not include the compiler and only works with precompiled templates. Recommended for production.
Loading methods
Script tag:
<script src="nunjucks.js"></script>AMD module:
define(['nunjucks'], function(nunjucks) {
});