@videinfra/static-website-builder 1.17.0 → 1.17.2

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,14 @@ 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.17.2] - 2026-02-19
8
+ ### Fixed
9
+ - Removed file extension from the sitemap URLs
10
+
11
+ ## [1.17.1] - 2026-01-23
12
+ ### Added
13
+ - Sitemap generation in watch mode too
14
+
7
15
  ## [1.17.0] - 2026-01-15
8
16
  ### Added
9
17
  - Added sitemap task
@@ -5,6 +5,15 @@ const { series, parallel } = require('gulp');
5
5
  const { DEFAULT_TASKS, BUILD_TASKS } = require('./task-order');
6
6
  const resolveDynamicTask = require('./gulp/resolve-dynamic-task');
7
7
 
8
+ /**
9
+ * Sort tasks by .order property
10
+ *
11
+ * @param {array} tasks Tasks
12
+ * @returns {array} Sorted tasks
13
+ */
14
+ function sortTasks (tasks) {
15
+ return tasks.sort((a, b) => (a.order || 0) - (b.order || 0));
16
+ }
8
17
 
9
18
  /**
10
19
  * Organize and order tasks
@@ -46,8 +55,8 @@ function generateTaskList (taskConfig) {
46
55
  }
47
56
  }
48
57
 
49
- taskList.default = filter(taskList.default, taskGroup => taskGroup.length);
50
- taskList.build = filter(taskList.build, taskGroup => taskGroup.length);
58
+ taskList.default = filter(taskList.default, taskGroup => taskGroup.length).sort(sortTasks);
59
+ taskList.build = filter(taskList.build, taskGroup => taskGroup.length).sort(sortTasks);
51
60
 
52
61
  return taskList;
53
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videinfra/static-website-builder",
3
- "version": "1.17.0",
3
+ "version": "1.17.2",
4
4
  "description": "Customizable static site project builder",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -4,3 +4,6 @@ const getConfig = require('./../../lib/get-config');
4
4
  exports.watch = function browserSync (callback) {
5
5
  bs.init(getConfig.getTaskConfig('browserSync'));
6
6
  };
7
+
8
+ // Execute as first task
9
+ exports.watch.order = -2;
@@ -86,6 +86,5 @@ function htmlWatch () {
86
86
  return taskWatch(getWatchGlobPaths(), html({ build: false }));
87
87
  }
88
88
 
89
-
90
89
  exports.build = html({ build: true });
91
90
  exports.watch = htmlWatch;
@@ -18,6 +18,11 @@ exports.sitemap = {
18
18
  priority: function(siteUrl, loc, entry) {
19
19
  return loc === siteUrl ? 1 : 0.9;
20
20
  },
21
+
22
+ // Remove file extension from the URL
23
+ getLoc: function(siteUrl, loc, entry) {
24
+ return loc.replace(/\.\w+$/, '');
25
+ },
21
26
  },
22
27
 
23
28
  // Production only settings, overwrites default settings
@@ -11,7 +11,7 @@ const globs = require('./../../lib/globs-helper');
11
11
  const taskStart = require('../../lib/gulp/task-start');
12
12
  const taskEnd = require('../../lib/gulp/task-end');
13
13
  const taskBeforeDest = require('../../lib/gulp/task-before-dest');
14
-
14
+ const taskWatch = require('../../lib/gulp/task-watch');
15
15
 
16
16
  const getGlobPaths = memoize(function () {
17
17
  const sourcePaths = getPaths.getDestPath('html');
@@ -31,22 +31,29 @@ const getGlobIgnorePaths = memoize(function () {
31
31
  });
32
32
 
33
33
  function sitemap () {
34
- return function sitemap () {
35
- return gulp.src(getGlobPaths())
36
- .pipe(taskStart())
34
+ return gulp.src(getGlobPaths())
35
+ .pipe(taskStart())
36
+
37
+ // Prevent file from being rendered if it's in the ignore list
38
+ .pipe(gulpif(!!getGlobIgnorePaths().length, ignore.exclude(getGlobIgnorePaths(), {})))
37
39
 
38
- // Prevent file from being rendered if it's in the ignore list
39
- .pipe(gulpif(!!getGlobIgnorePaths().length, ignore.exclude(getGlobIgnorePaths(), {})))
40
+ // Preprocess sitemap
41
+ .pipe(gulpSitemap(getConfig.getTaskConfig('sitemap').sitemap))
40
42
 
41
- // Preprocess sitemap
42
- .pipe(gulpSitemap(getConfig.getTaskConfig('sitemap').sitemap))
43
+ .pipe(taskBeforeDest())
44
+ .pipe(gulp.dest(getPaths.getDestPath('sitemap')))
43
45
 
44
- .pipe(taskBeforeDest())
45
- .pipe(gulp.dest(getPaths.getDestPath('sitemap')))
46
+ // Reload on change
47
+ .pipe(taskEnd());
48
+ }
46
49
 
47
- // Reload on change
48
- .pipe(taskEnd());
49
- };
50
+ function sitemapWatch () {
51
+ // Watch and execute immediatelly so that sitemap is generated on first run
52
+ return taskWatch(getGlobPaths(), sitemap) && sitemap();
50
53
  }
51
54
 
52
- exports.afterBuild = sitemap();
55
+ exports.afterBuild = sitemap;
56
+ exports.watch = sitemapWatch;
57
+
58
+ // Execute after HTML task
59
+ exports.watch.order = 1;