vite-plugin-prototype-nunjucks
v1.0.4
Published
```twig <ul id="navigation"> {% for item in ['Home', 'About'] %} <li>{{ item }}</li> {% endfor %} </ul> ```
Downloads
17
Maintainers
Readme
Nunjucks
<ul id="navigation">
{% for item in ['Home', 'About'] %}
<li>{{ item }}</li>
{% endfor %}
</ul>See docs for more info about the syntax
Install
npm
npm i vite-plugin-prototype-nunjucks -Dpnpm
pnpm i vite-plugin-prototype-nunjucks -DConfig
import prototype from 'vite-plugin-prototype'
import nunjucks from 'vite-plugin-prototype-nunjucks'
export default {
plugins: [prototype(), nunjucks()],
}Options
options
- Type:
nunjucks.ConfigureOptions - Default:
{}
Additional Nunjucks options, see Nunjucks docs for more info.
reload
- Type:
boolean | ((file: string) => boolean) - Default:
true
Whenever to auto-reload browser window upon njk file change. You can also provide function to filter upon which file a reload should occur.
data
- Type:
object - Default:
{}
Additional data provide to template
onSetup
- Type:
(template: nunjucks.Environment, path: string, config: UserConfig) => void - Default:
true
Called after the nunjucks environment is created. Use this hook to get to the nunjucks API
