@webdiscus/pug-loader
Advanced tools
Changelog
1.4.2 (2021-11-18)
- var someData = require('some-data.json');
each item in someData
p= item.anyProperty
Changelog
1.4.0 (2021-11-16)
esModule
to enable/disable ES modules syntax in generated JS modulesChangelog
1.3.0 (2021-11-15)
render
method has been improved. Now the method render a pug into HTML really at compile time without
limitations for resolving an embedded resource.
This method do same result as any other pug-loader + html-loader, even faster, generate smaller code and with all that
not need an additional loader.Changelog
1.2.0 (2021-11-12)
html
to render the template function into pure HTML string,html-loader
Changelog
1.1.0 (2021-11-10)
compile
or render
methods in JavaScript:
method: render|compile
to render into HTML or compile into a template function all templates
required in js file?pug-render
to render the pug template directly into HTML,
independent of loader option method
, const html = require('template.pug?pug-render')
?pug-compile
to compile the pug template into a
template function, independent of loader option method
, const tmpl = require('template.pug?pug-compile')
data: {}
to pass a data into all templates at compile time, e.g. useful for the i18n datakey=value
or JSON {key:value}
parameters to pass them into the
template at compile time, const tmpl = require('template.pug?key1=value1&{"key2":"value2","key3":"value3"}')