Releases: webdiscus/pug-loader
Releases · webdiscus/pug-loader
v2.10.6
v2.10.5
Cumulative Release v1.7.0 - v2.10.5
Features
- Added supports for inline JS.
- Added resolving required resources in attribute blocks:
img&attributes({ src: require('./image.png'), srcset: `${require('./image1.png')} 80w, ${require('./image2.png')} 90w`, })
- Added resolving for require in conditional, e.g.:
if condition img(src=require('./image1.png')) else img(src=require('./image2.png'))
- Added resolving for require in mixin argument, e.g.
+image(require('./logo.png'), 'logo'). - Added resolving for require in
each inand ineach ofiteration object, e.g.each [key, img] of new Map([['apple', require('./apple.png')], ['sony', require('./sony.png')]]). - Added supports for a string value by the
watchFilesoption. - Added resolving of file alias for scripts and styles.
- Display the error message on broken page due to fatal error.
- Added LiveReload support on broken page due to fatal error.
- Added support the resolving a file alias in
include. - Added
watchFilesoption to watch for file changes in resolved dependencies. - Added support the Pug in Vue.
- Added support an indent in Vue template for Pug code.
- Added embedded filter
:markdownwith highlighting code blocks. - Added embedded filters
:code,:highlight. - Added the
embedFilteroption to enable using in pug filters embedded in pug-loader. - Added embedded
:escapefilter to escape HTML tags. - Added supports the require() of the javascript source files directly in pug (works only with pug-plugin).
It is no longer necessary to define a js file in webpack entry-point.
For example, using thepug-pluginnow following is possible:Generated HTML:script(src=require('./main.js'))
<script src='/assets/js/main.1234abcd.js'></script>
- Added support a function in loader option
dataforcompilemethod. - Added resolving the variable contained a subdirectory in the relative path:
- var file = './subdir/image.jpg'; img(src=require(file))
- Added resolving a required path in the variable:
- var file = require('./subdir/image.jpg'); img(src=file)
- Added watching of required
jsandjsonfiles in pug. - Added supports for webpack alias as array of paths, #10.
Bug Fixes
- Watch the SVG files referenced with a fragment, e.g. icons.svg#home.
- Added missing node modules to compilation after rebuild.
- Fixed loader export when template contain CRLF line separators.
- Fixed resolving of inline JS source file.
- Fixed asset name of script for multi-lang pages.
- Store unique script and set actual asset name of script by LiveReload.
- Fixed passing data option when the self options is true in compile method.
- Fixed resolving of assets in pug templates with url query.
- Fixed resolving of modules whose package.json contains
exportsfield. - Added minimal required version of
enhanced-resolveinpeerDependenciesto avoid using incompatible version by other modules. - Fixed last stable version of ansis in package.json to avoid issues in dependency.
- Fixed resolving of the style in Pug from node_modules by module name, e.g.:
link(href=require('bootstrap') rel='stylesheet'). - Allow to use url query in script source file.
- Fixed resolving of absolute path using root context.
- Fixed resolving of alias to file using root context.
- Fixed issues by resolving Pug aliases on Windows.
- Fixed warning by watching interpolated dependencies with
compilemethod. - Added supports for Webpack resolve modules.
- Fixed require() value with complex interpolation.
- Encode reserved chars for resource query.
- Added support the prefixes
~@for file alias. - Fixed the
:markdownfilter, enable HTML tags in markdown source. - Fixed pug error in dependency requires restart of webpack, #14.
- Added
&and"chars in:escapefilter. - Added support resolving npm modules in pug template.
- Fixed collision with local variables passed in template function for compile method.
- Fixed path error in Windows when watching dependencies.
- Fixed optional prefix of alias in request when an alias name self contains the prefix.
- Changed the evaluation to interpolation of required files for
compilemethod to fix issueundefined variable. - Fixed issue
undefined variablefor methodcompileby use the variables in pug w/o optional chaining.
Native resolving of a file using require() in pug
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.
v1.6.1
2022-01-20
Improvement of file resolving
- added supports for resolving of aliases from webpack
resolve.pluginsby required resources, like styles, scripts - added supports for resolving of
srcsetattribute inimgtag - improve resolving the required files by all methods
- fix resolving issues by usage the variable filename contained parent relative path in require() function
- refactoring
- added more test cases