Skip to content

Releases: webdiscus/pug-loader

v2.10.6

17 Mar 00:05
769f51f
Compare
Choose a tag to compare

v2.10.6

Bug Fixes

  • Fixed caching user data from html-webpack-plugin by template filename with query.

v2.10.5

13 Oct 10:27
94de200
Compare
Choose a tag to compare

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 in and in each of iteration 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 watchFiles option.
  • 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 watchFiles option 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 :markdown with highlighting code blocks.
  • Added embedded filters :code, :highlight.
  • Added the embedFilter option to enable using in pug filters embedded in pug-loader.
  • Added embedded :escape filter 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 the pug-plugin now following is possible:
    script(src=require('./main.js'))
    Generated HTML:
    <script src='/assets/js/main.1234abcd.js'></script>
  • Added support a function in loader option data for compile method.
  • 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 js and json files 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 exports field.
  • Added minimal required version of enhanced-resolve in peerDependencies to 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 compile method.
  • 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 :markdown filter, enable HTML tags in markdown source.
  • Fixed pug error in dependency requires restart of webpack, #14.
  • Added & and " chars in :escape filter.
  • 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 compile method to fix issue undefined variable.
  • Fixed issue undefined variable for method compile by use the variables in pug w/o optional chaining.

Native resolving of a file using require() in pug

05 Feb 20:18
Compare
Choose a tag to compare

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

20 Jan 21:21
Compare
Choose a tag to compare

2022-01-20

Improvement of file resolving

  • added supports for resolving of aliases from webpack resolve.plugins by required resources, like styles, scripts
  • added supports for resolving of srcset attribute in img tag
  • 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

v1.6.0

12 Jan 12:46
Compare
Choose a tag to compare

2022-01-12

  • added supports for resolving aliases from webpack resolve.plugins for include and extends