@videinfra/static-website-builder 2.3.1 → 2.4.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,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
+ ## [2.4.0] - 2026-04-23
8
+ ### Added
9
+ - Allow to specify builder config file path using `BUILDER_CONFIG_FILE` env variable
10
+
11
+ ## [2.3.2] - 2026-04-13
12
+ ### Fixed
13
+ - Translation error output
14
+
7
15
  ## [2.3.0] - 2026-04-09
8
16
  ### Addded
9
17
  - Translation support for TWIG
package/gulpfile.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { getConfigAsync } from './lib/get-config.js';
2
2
  import generateGulpTasks from './lib/generate-gulp-tasks.js';
3
+ import { getProjectPath } from './lib/get-path.js';
4
+ import dotenv from 'dotenv';
3
5
 
4
6
  // Set mode globally it can be used by tasks
5
7
  let hasProductionArg = false;
@@ -15,9 +17,27 @@ for (let i = 0; i < process.argv.length; i++) {
15
17
  global.production = global.production || hasProductionArg || process.env.NODE_ENV === 'production';
16
18
  global.development = !global.production;
17
19
 
18
- // Config file
19
- let builderConfigFile = process.env.BUILDER_CONFIG_FILE || 'config/config.js';
20
+ // Load environment variables from .env files
21
+ let builderConfigFile = 'config/config.js';
22
+
23
+ if (process.env.BUILDER_CONFIG_FILE) {
24
+ builderConfigFile = process.env.BUILDER_CONFIG_FILE;
25
+ } else {
26
+ const envVariables = {};
27
+ dotenv.config({
28
+ // dotenv file order is reversed, values in first file overwrite all other
29
+ // file values
30
+ path: ['../.env', '../.env.local'].map((path) => getProjectPath(path)).reverse(),
31
+ processEnv: envVariables,
32
+ quiet: true,
33
+ });
34
+
35
+ if (envVariables.BUILDER_CONFIG_FILE) {
36
+ builderConfigFile = envVariables.BUILDER_CONFIG_FILE;
37
+ }
38
+ }
20
39
 
40
+ // Config file
21
41
  if (process.argv.indexOf('--config') !== -1) {
22
42
  builderConfigFile = process.argv[process.argv.indexOf('--config') + 1];
23
43
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videinfra/static-website-builder",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "Customizable static site project builder",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -33,9 +33,10 @@ export default function getTranslations(locale, group) {
33
33
  cache = merge(cache, { [locale]: { [group]: fileData }});
34
34
  } catch (err) {
35
35
  logError({
36
- message: `Failed to parse "${path.join(getPathConfig().src, getPathConfig().data.src, fileName)}"`,
36
+ message: `Failed to parse "${path.join(getPathConfig().src, getPathConfig().data.src, `${group}.${locale}.yml`)}"`,
37
37
  plugin: 'data',
38
38
  });
39
+ console.error(err.message);
39
40
  }
40
41
  }
41
42
  });