Pug loader for Webpack renders pug to HTML or template function
ISC License
Bot releases are hidden (Show)
Published by webdiscus about 1 year ago
v1.7.0
- v2.10.5
img&attributes({
src: require('./image.png'),
srcset: `${require('./image1.png')} 80w, ${require('./image2.png')} 90w`,
})
if condition
img(src=require('./image1.png'))
else
img(src=require('./image2.png'))
+image(require('./logo.png'), 'logo')
.each in
and in each of
iteration object, e.g. each [key, img] of new Map([['apple', require('./apple.png')], ['sony', require('./sony.png')]])
.watchFiles
option.include
.watchFiles
option to watch for file changes in resolved dependencies.:markdown
with highlighting code blocks.:code
, :highlight
.embedFilter
option to enable using in pug filters embedded in pug-loader.:escape
filter to escape HTML tags.pug-plugin
now following is possible:
script(src=require('./main.js'))
Generated HTML:
<script src='/assets/js/main.1234abcd.js'></script>
data
for compile
method.- var file = './subdir/image.jpg';
img(src=require(file))
- var file = require('./subdir/image.jpg');
img(src=file)
js
and json
files in pug.exports
field.enhanced-resolve
in peerDependencies
to avoid using incompatible version by other modules.link(href=require('bootstrap') rel='stylesheet')
.compile
method.~
@
for file alias.:markdown
filter, enable HTML tags in markdown source.&
and "
chars in :escape
filter.compile
method to fix issue undefined variable
.undefined variable
for method compile
by use the variables in pug w/o optional chaining.Published by webdiscus over 2 years ago
In this release all methods compile
render
html
supports native resolving of embedded resources such as images, fonts, etc, using require() in compiled JabaScript context.
But the method compile
has the limitation: used variables with properties muss have optional optional chaining ?.
, e.g. data?.items?.name
.
In next release will be used by the method compile
the default webpack require(), that has any limitation by resolving a variable in argument of require(), but has no limitation by using the variables in pug.
Published by webdiscus over 2 years ago
resolve.plugins
by required resources, like styles, scriptssrcset
attribute in img
tagPublished by webdiscus almost 3 years ago
resolve.plugins
for include and extends