@videinfra/static-website-builder 1.13.4 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [1.14.0] - 2025-01-16
8
+ ### Added
9
+ - Fail build process when TWIG task fails
10
+
7
11
  ## [1.13.4] - 2024-10-08
8
12
  ### Fixed
9
13
  - Fail gulp process when htmlmin task fails
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videinfra/static-website-builder",
3
- "version": "1.13.4",
3
+ "version": "1.14.0",
4
4
  "description": "Customizable static site project builder",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -27,6 +27,12 @@ module.exports = function preprocessHTMLConfig (config = {}, fullConfig) {
27
27
  if (config.twig.filters) {
28
28
  config.twig.filters = flattenDeep(config.twig.filters);
29
29
  }
30
+ if (Array.isArray(config.twig.extend)) {
31
+ const extendFnList = config.twig.extend;
32
+ config.twig.extend = function (Twig) {
33
+ extendFnList.forEach((fn) => fn(Twig));
34
+ };
35
+ }
30
36
 
31
37
  // Main 'dependents' config is shared between all tasks
32
38
  if (config.dependents) {
package/plugins/twig.js CHANGED
@@ -33,6 +33,9 @@ exports.html = {
33
33
  // Disabled cache by default, it's enabled for production build only
34
34
  cache: false,
35
35
 
36
+ // Rethrow TWIG error so that process exists
37
+ rethrow: true,
38
+
36
39
  // Custom functions
37
40
  functions: [
38
41
  // require('../../plugins/twig/symfony-functions.js'),
@@ -43,7 +43,7 @@ module.exports = function (options) {
43
43
  twig = Twig.twig,
44
44
  twigOpts = {
45
45
  path: file.path,
46
- async: false
46
+ async: false,
47
47
  },
48
48
  template;
49
49
 
@@ -59,6 +59,9 @@ module.exports = function (options) {
59
59
  if (options.namespaces !== undefined) {
60
60
  twigOpts.namespaces = options.namespaces;
61
61
  }
62
+ if (options.rethrow !== undefined) {
63
+ twigOpts.rethrow = options.rethrow;
64
+ }
62
65
  if (options.cache !== true) {
63
66
  Twig.cache(false);
64
67
  }