@videinfra/static-website-builder 2.0.0-beta.2 → 2.0.0-beta.4

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.
Files changed (102) hide show
  1. package/.prettierrc +11 -0
  2. package/README.md +2 -2
  3. package/bin/builder.js +17 -11
  4. package/eslint.config.js +39 -0
  5. package/gulpfile.js +63 -0
  6. package/init/default/config/config.js +18 -15
  7. package/init/default/src/html/data/global.js +1 -1
  8. package/init/default/src/javascripts/_entries.js +1 -1
  9. package/init/index.js +44 -37
  10. package/init/test/config/config.js +20 -16
  11. package/init/test/src/html/data/global.js +1 -1
  12. package/lib/camelize-file-name.js +1 -1
  13. package/lib/generate-gulp-tasks.js +12 -10
  14. package/lib/get-config.js +99 -52
  15. package/lib/get-file-names.js +3 -3
  16. package/lib/get-path.js +15 -22
  17. package/lib/globs-helper.js +22 -47
  18. package/lib/gulp/dynamic-task.js +1 -1
  19. package/lib/gulp/resolve-dynamic-task.js +1 -1
  20. package/lib/gulp/task-before-dest.js +2 -2
  21. package/lib/gulp/task-end.js +5 -5
  22. package/lib/gulp/task-start.js +3 -3
  23. package/lib/gulp/task-watch.js +10 -10
  24. package/lib/init/copy-folder.js +4 -4
  25. package/lib/init/folder-exists.js +2 -2
  26. package/lib/init/get-folder-list.js +3 -3
  27. package/lib/init/merge-package.js +8 -8
  28. package/lib/init/read-package.js +2 -2
  29. package/lib/log-error.js +3 -3
  30. package/lib/merge.js +3 -3
  31. package/lib/run-preprocess.js +2 -2
  32. package/lib/task-order.js +7 -13
  33. package/package.json +6 -4
  34. package/plugins/example/preprocess-config.js +1 -1
  35. package/plugins/example/task.js +13 -13
  36. package/plugins/example.js +8 -6
  37. package/plugins/sass-engine/preprocess-config.js +15 -19
  38. package/plugins/sass.js +5 -3
  39. package/plugins/twig/lodash-filters/filters.js +12 -10
  40. package/plugins/twig/lodash-filters.js +3 -3
  41. package/plugins/twig/symfony-filters/filters.js +18 -14
  42. package/plugins/twig/symfony-filters/preposition_nbsp.js +1 -1
  43. package/plugins/twig/symfony-filters.js +6 -6
  44. package/plugins/twig/symfony-functions/functions.js +2 -2
  45. package/plugins/twig/symfony-functions.js +6 -6
  46. package/plugins/twig-engine/preprocess-config.js +8 -8
  47. package/plugins/twig.js +11 -6
  48. package/tasks/browser-sync/config.js +9 -6
  49. package/tasks/browser-sync/preprocess-config.js +5 -7
  50. package/tasks/browser-sync/task.js +5 -5
  51. package/tasks/clean/config.js +8 -5
  52. package/tasks/clean/preprocess-config.js +5 -5
  53. package/tasks/clean/task.js +5 -5
  54. package/tasks/data/config.js +11 -13
  55. package/tasks/data/data-loader-js.js +11 -2
  56. package/tasks/data/data-loader-json.js +3 -3
  57. package/tasks/data/get-data.js +55 -52
  58. package/tasks/env/config.js +2 -2
  59. package/tasks/env/get-env.js +34 -19
  60. package/tasks/fonts/config.js +9 -10
  61. package/tasks/fonts/task.js +27 -27
  62. package/tasks/global/config.js +1 -1
  63. package/tasks/html/config.js +13 -15
  64. package/tasks/html/task.js +55 -54
  65. package/tasks/icons/config.js +17 -22
  66. package/tasks/icons/preprocess-config.js +4 -4
  67. package/tasks/icons/task.js +34 -35
  68. package/tasks/images/config.js +11 -14
  69. package/tasks/images/task.js +26 -26
  70. package/tasks/javascripts/config.js +12 -14
  71. package/tasks/javascripts/preprocess-config.js +45 -32
  72. package/tasks/javascripts/task.js +40 -43
  73. package/tasks/sitemap/config.js +12 -13
  74. package/tasks/sitemap/preprocess-config.js +2 -2
  75. package/tasks/sitemap/task.js +44 -38
  76. package/tasks/sizereport/config.js +5 -3
  77. package/tasks/sizereport/task.js +8 -8
  78. package/tasks/static/config.js +12 -15
  79. package/tasks/static/task.js +27 -28
  80. package/tasks/stylesheets/config.js +16 -19
  81. package/tasks/stylesheets/preprocess-config.js +5 -5
  82. package/tasks/stylesheets/task.js +28 -28
  83. package/tests/build/build.test.js +23 -22
  84. package/tests/camelize-file-name.test.js +1 -1
  85. package/tests/generate-gulp-tasks.test.js +11 -5
  86. package/tests/glob-helper.test.js +1 -1
  87. package/tests/merge.test.js +1 -1
  88. package/tests/preposition_nbsp.test.js +7 -6
  89. package/tests/run-preprocess.test.js +2 -1
  90. package/tests/sass-stringify.test.js +1 -1
  91. package/tests/sitemap.test.js +7 -6
  92. package/vendor/gulp-rolldown/index.js +24 -56
  93. package/vendor/gulp-rolldown/plugin-raw.js +17 -0
  94. package/vendor/gulp-rolldown/plugin-virtual-entry.js +30 -0
  95. package/vendor/gulp-sass/README.md +10 -19
  96. package/vendor/gulp-sass/index.js +129 -135
  97. package/vendor/gulp-sass/package.json +1 -0
  98. package/vendor/gulp-sass/sass-stringify.js +1 -1
  99. package/vendor/gulp-twig/index.js +32 -27
  100. package/vendor/gulp-twig/package.json +1 -0
  101. package/.eslintrc.js +0 -35
  102. package/gulpfile.js/index.js +0 -32
@@ -1,15 +1,15 @@
1
1
  // 2025-01-20, Kaspars Zuks: added "options.data" support for variables
2
2
  'use strict';
3
3
 
4
- const path = require('path');
5
- const { Transform } = require('stream');
6
- const picocolors = require('picocolors');
7
- const PluginError = require('plugin-error');
8
- const replaceExtension = require('replace-ext');
9
- const stripAnsi = require('strip-ansi');
10
- const clonedeep = require('lodash.clonedeep');
11
- const applySourceMap = require('vinyl-sourcemaps-apply');
12
- const sassStingify = require('./sass-stringify')
4
+ import path from 'path';
5
+ import { Transform } from 'stream';
6
+ import picocolors from 'picocolors';
7
+ import PluginError from 'plugin-error';
8
+ import replaceExtension from 'replace-ext';
9
+ import stripAnsi from 'strip-ansi';
10
+ import clonedeep from 'lodash.clonedeep';
11
+ import applySourceMap from 'vinyl-sourcemaps-apply';
12
+ import sassStingify from './sass-stringify.js';
13
13
 
14
14
  const PLUGIN_NAME = 'gulp-sass';
15
15
 
@@ -18,7 +18,9 @@ gulp-sass no longer has a default Sass compiler; please set one yourself.
18
18
  Both the "sass" and "node-sass" packages are permitted.
19
19
  For example, in your gulpfile:
20
20
 
21
- const sass = require('gulp-sass')(require('sass'));
21
+ import * as sass from 'sass';
22
+ import gulpSass from 'gulp-sass';
23
+ const instance = gulpSass(sass);
22
24
  `;
23
25
 
24
26
  const transfob = (transform) => new Transform({ transform, objectMode: true });
@@ -27,60 +29,56 @@ const transfob = (transform) => new Transform({ transform, objectMode: true });
27
29
  * Handles returning the file to the stream
28
30
  */
29
31
  const filePush = (file, sassObject, callback) => {
30
- // Build Source Maps!
31
- if (sassObject.map) {
32
- // Transform map into JSON
33
- const sassMap = JSON.parse(sassObject.map.toString());
34
- // Grab the stdout and transform it into stdin
35
- const sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin');
36
- // Grab the base filename that's being worked on
37
- const sassFileSrc = file.relative;
38
- // Grab the path portion of the file that's being worked on
39
- const sassFileSrcPath = path.dirname(sassFileSrc);
40
-
41
- if (sassFileSrcPath) {
42
- const sourceFileIndex = sassMap.sources.indexOf(sassMapFile);
43
- // Prepend the path to all files in the sources array except the file that's being worked on
44
- sassMap.sources = sassMap.sources.map((source, index) => (
45
- index === sourceFileIndex
46
- ? source
47
- : path.join(sassFileSrcPath, source)
48
- ));
49
- }
32
+ // Build Source Maps!
33
+ if (sassObject.map) {
34
+ // Transform map into JSON
35
+ const sassMap = JSON.parse(sassObject.map.toString());
36
+ // Grab the stdout and transform it into stdin
37
+ const sassMapFile = sassMap.file.replace(/^stdout$/, 'stdin');
38
+ // Grab the base filename that's being worked on
39
+ const sassFileSrc = file.relative;
40
+ // Grab the path portion of the file that's being worked on
41
+ const sassFileSrcPath = path.dirname(sassFileSrc);
42
+
43
+ if (sassFileSrcPath) {
44
+ const sourceFileIndex = sassMap.sources.indexOf(sassMapFile);
45
+ // Prepend the path to all files in the sources array except the file that's being worked on
46
+ sassMap.sources = sassMap.sources.map((source, index) => (index === sourceFileIndex ? source : path.join(sassFileSrcPath, source)));
47
+ }
50
48
 
51
- // Remove 'stdin' from souces and replace with filenames!
52
- sassMap.sources = sassMap.sources.filter((src) => src !== 'stdin' && src);
49
+ // Remove 'stdin' from souces and replace with filenames!
50
+ sassMap.sources = sassMap.sources.filter((src) => src !== 'stdin' && src);
53
51
 
54
- // Replace the map file with the original filename (but new extension)
55
- sassMap.file = replaceExtension(sassFileSrc, '.css');
56
- // Apply the map
57
- applySourceMap(file, sassMap);
58
- }
52
+ // Replace the map file with the original filename (but new extension)
53
+ sassMap.file = replaceExtension(sassFileSrc, '.css');
54
+ // Apply the map
55
+ applySourceMap(file, sassMap);
56
+ }
59
57
 
60
- file.contents = sassObject.css;
61
- file.path = replaceExtension(file.path, '.css');
58
+ file.contents = sassObject.css;
59
+ file.path = replaceExtension(file.path, '.css');
62
60
 
63
- if (file.stat) {
64
- file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
65
- }
61
+ if (file.stat) {
62
+ file.stat.atime = file.stat.mtime = file.stat.ctime = new Date();
63
+ }
66
64
 
67
- callback(null, file);
65
+ callback(null, file);
68
66
  };
69
67
 
70
68
  /**
71
69
  * Handles error message
72
70
  */
73
71
  const handleError = (error, file, callback) => {
74
- const filePath = (error.file === 'stdin' ? file.path : error.file) || file.path;
75
- const relativePath = path.relative(process.cwd(), filePath);
76
- const message = `${picocolors.underline(relativePath)}\n${error.formatted}`;
72
+ const filePath = (error.file === 'stdin' ? file.path : error.file) || file.path;
73
+ const relativePath = path.relative(process.cwd(), filePath);
74
+ const message = `${picocolors.underline(relativePath)}\n${error.formatted}`;
77
75
 
78
- error.messageFormatted = message;
79
- error.messageOriginal = error.message;
80
- error.message = stripAnsi(message);
81
- error.relativePath = relativePath;
76
+ error.messageFormatted = message;
77
+ error.messageOriginal = error.message;
78
+ error.message = stripAnsi(message);
79
+ error.relativePath = relativePath;
82
80
 
83
- return callback(new PluginError(PLUGIN_NAME, error));
81
+ return callback(new PluginError(PLUGIN_NAME, error));
84
82
  };
85
83
 
86
84
  /**
@@ -93,9 +91,9 @@ const escapeSCSSVariable = (value) => {
93
91
  return String(value);
94
92
  } else {
95
93
  // Convert to string
96
- return "'" + value.toString().replace(/\\/g, '\\\\').replace(/'/g, '\\\'').replace(/\n/g, '\\n') + "'";
94
+ return "'" + value.toString().replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/\n/g, '\\n') + "'";
97
95
  }
98
- }
96
+ };
99
97
 
100
98
  /**
101
99
  * Main Gulp Sass function
@@ -103,85 +101,85 @@ const escapeSCSSVariable = (value) => {
103
101
 
104
102
  // eslint-disable-next-line arrow-body-style
105
103
  const gulpSass = (options, sync) => {
106
- return transfob((file, encoding, callback) => {
107
- if (file.isNull()) {
108
- callback(null, file);
109
- return;
110
- }
111
-
112
- if (file.isStream()) {
113
- callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
114
- return;
115
- }
104
+ return transfob((file, encoding, callback) => {
105
+ if (file.isNull()) {
106
+ callback(null, file);
107
+ return;
108
+ }
116
109
 
117
- if (path.basename(file.path).startsWith('_')) {
118
- callback();
119
- return;
120
- }
110
+ if (file.isStream()) {
111
+ callback(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
112
+ return;
113
+ }
121
114
 
122
- if (!file.contents.length) {
123
- file.path = replaceExtension(file.path, '.css');
124
- callback(null, file);
125
- return;
126
- }
115
+ if (path.basename(file.path).startsWith('_')) {
116
+ callback();
117
+ return;
118
+ }
127
119
 
128
- const opts = clonedeep(options || {});
129
- opts.data = file.contents.toString();
120
+ if (!file.contents.length) {
121
+ file.path = replaceExtension(file.path, '.css');
122
+ callback(null, file);
123
+ return;
124
+ }
130
125
 
131
- // Stringiyfy variables
132
- if (options.data) {
133
- opts.data = sassStingify(options.data) + opts.data;
134
- }
126
+ const opts = clonedeep(options || {});
127
+ opts.data = file.contents.toString();
135
128
 
136
- // We set the file path here so that libsass can correctly resolve import paths
137
- opts.file = file.path;
129
+ // Stringiyfy variables
130
+ if (options.data) {
131
+ opts.data = sassStingify(options.data) + opts.data;
132
+ }
138
133
 
139
- // Ensure `indentedSyntax` is true if a `.sass` file
140
- if (path.extname(file.path) === '.sass') {
141
- opts.indentedSyntax = true;
142
- }
134
+ // We set the file path here so that libsass can correctly resolve import paths
135
+ opts.file = file.path;
143
136
 
144
- // Ensure file's parent directory in the include path
145
- if (opts.includePaths) {
146
- if (typeof opts.includePaths === 'string') {
147
- opts.includePaths = [opts.includePaths];
148
- }
149
- } else {
150
- opts.includePaths = [];
151
- }
137
+ // Ensure `indentedSyntax` is true if a `.sass` file
138
+ if (path.extname(file.path) === '.sass') {
139
+ opts.indentedSyntax = true;
140
+ }
152
141
 
153
- opts.includePaths.unshift(path.dirname(file.path));
142
+ // Ensure file's parent directory in the include path
143
+ if (opts.includePaths) {
144
+ if (typeof opts.includePaths === 'string') {
145
+ opts.includePaths = [opts.includePaths];
146
+ }
147
+ } else {
148
+ opts.includePaths = [];
149
+ }
154
150
 
155
- // Generate Source Maps if the source-map plugin is present
156
- if (file.sourceMap) {
157
- opts.sourceMap = file.path;
158
- opts.omitSourceMapUrl = true;
159
- opts.sourceMapContents = true;
160
- }
151
+ opts.includePaths.unshift(path.dirname(file.path));
161
152
 
162
- if (sync !== true) {
163
- /**
164
- * Async Sass render
165
- */
166
- gulpSass.compiler.render(opts, (error, obj) => {
167
- if (error) {
168
- handleError(error, file, callback);
169
- return;
153
+ // Generate Source Maps if the source-map plugin is present
154
+ if (file.sourceMap) {
155
+ opts.sourceMap = file.path;
156
+ opts.omitSourceMapUrl = true;
157
+ opts.sourceMapContents = true;
170
158
  }
171
159
 
172
- filePush(file, obj, callback);
173
- });
174
- } else {
175
- /**
176
- * Sync Sass render
177
- */
178
- try {
179
- filePush(file, gulpSass.compiler.renderSync(opts), callback);
180
- } catch (error) {
181
- handleError(error, file, callback);
182
- }
183
- }
184
- });
160
+ if (sync !== true) {
161
+ /**
162
+ * Async Sass render
163
+ */
164
+ gulpSass.compiler.render(opts, (error, obj) => {
165
+ if (error) {
166
+ handleError(error, file, callback);
167
+ return;
168
+ }
169
+
170
+ filePush(file, obj, callback);
171
+ });
172
+ } else {
173
+ /**
174
+ * Sync Sass render
175
+ */
176
+ try {
177
+ filePush(file, gulpSass.compiler.renderSync(opts), callback);
178
+ } catch (error) {
179
+ handleError(error, file, callback);
180
+ }
181
+ }
182
+ });
185
183
  };
186
184
 
187
185
  /**
@@ -193,22 +191,18 @@ gulpSass.sync = (options) => gulpSass(options, true);
193
191
  * Log errors nicely
194
192
  */
195
193
  gulpSass.logError = function logError(error) {
196
- const message = new PluginError('sass', error.messageFormatted).toString();
197
- process.stderr.write(`${message}\n`);
198
- this.emit('end');
194
+ const message = new PluginError('sass', error.messageFormatted).toString();
195
+ process.stderr.write(`${message}\n`);
196
+ this.emit('end');
199
197
  };
200
198
 
201
- module.exports = (compiler) => {
202
- if (!compiler || !compiler.render) {
203
- const message = new PluginError(
204
- PLUGIN_NAME,
205
- MISSING_COMPILER_MESSAGE,
206
- { showProperties: false },
207
- ).toString();
208
- process.stderr.write(`${message}\n`);
209
- process.exit(1);
210
- }
199
+ export default (compiler) => {
200
+ if (!compiler || !compiler.render) {
201
+ const message = new PluginError(PLUGIN_NAME, MISSING_COMPILER_MESSAGE, { showProperties: false }).toString();
202
+ process.stderr.write(`${message}\n`);
203
+ process.exit(1);
204
+ }
211
205
 
212
- gulpSass.compiler = compiler;
213
- return gulpSass;
206
+ gulpSass.compiler = compiler;
207
+ return gulpSass;
214
208
  };
@@ -6,6 +6,7 @@
6
6
  "engines": {
7
7
  "node": ">=12"
8
8
  },
9
+ "type": "module",
9
10
  "scripts": {
10
11
  "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .",
11
12
  "fix": "npm run lint -- --fix",
@@ -1,4 +1,4 @@
1
- module.exports = function sassStingify (data, isDeep = false) {
1
+ export default function sassStingify (data, isDeep = false) {
2
2
  if (data === null || data === undefined) {
3
3
  return 'false';
4
4
  } else if (data !== '' && (data === 'true' || data === 'false' || data === true || data === false || !isNaN(data))) {
@@ -1,19 +1,24 @@
1
1
  // 2024-02-13, Kaspars Zuks: added "options.async" support
2
- var map = require('map-stream');
3
- var rext = require('replace-ext');
4
- var log = require('fancy-log');
5
- var PluginError = require('plugin-error');
2
+ import map from 'map-stream';
3
+ import rext from 'replace-ext';
4
+ import log from 'fancy-log';
5
+ import PluginError from 'plugin-error';
6
+ import Twig from 'twig';
6
7
 
7
8
  const PLUGIN_NAME = 'gulp-twig';
8
9
 
9
- module.exports = function (options) {
10
+ export default function (options) {
10
11
  'use strict';
11
- options = Object.assign({}, {
12
- changeExt: true,
13
- extname: '.html',
14
- useFileContents: false,
15
- async: true,
16
- }, options || {});
12
+ options = Object.assign(
13
+ {},
14
+ {
15
+ changeExt: true,
16
+ extname: '.html',
17
+ useFileContents: false,
18
+ async: true,
19
+ },
20
+ options || {},
21
+ );
17
22
 
18
23
  function modifyContents(file, cb) {
19
24
  var data = file.data || Object.assign({}, options.data);
@@ -26,21 +31,20 @@ module.exports = function (options) {
26
31
  return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported!'));
27
32
  }
28
33
 
29
- data._file = file;
30
- if(options.changeExt === false || options.extname === true){
34
+ data._file = file;
35
+ if (options.changeExt === false || options.extname === true) {
31
36
  data._target = {
32
- path: file.path,
33
- relative: file.relative
34
- }
35
- }else{
37
+ path: file.path,
38
+ relative: file.relative,
39
+ };
40
+ } else {
36
41
  data._target = {
37
42
  path: rext(file.path, options.extname || ''),
38
- relative: rext(file.relative, options.extname || '')
39
- }
43
+ relative: rext(file.relative, options.extname || ''),
44
+ };
40
45
  }
41
46
 
42
- var Twig = require('twig'),
43
- twig = Twig.twig,
47
+ var twig = Twig.twig,
44
48
  twigOpts = {
45
49
  path: file.path,
46
50
  async: false,
@@ -78,20 +82,21 @@ module.exports = function (options) {
78
82
  });
79
83
  }
80
84
 
81
- if(options.extend) {
85
+ if (options.extend) {
82
86
  Twig.extend(options.extend);
83
87
  delete options.extend;
84
88
  }
85
89
 
86
90
  if (options.useFileContents) {
87
- var fileContents = file.contents.toString();
88
- twigOpts.data = fileContents
91
+ var fileContents = file.contents.toString();
92
+ twigOpts.data = fileContents;
89
93
  }
90
94
 
91
95
  template = twig(twigOpts);
92
96
 
93
97
  if (options.async) {
94
- template.renderAsync(data)
98
+ template
99
+ .renderAsync(data)
95
100
  .then(function (output) {
96
101
  file.contents = new Buffer(output);
97
102
  file.path = data._target.path;
@@ -111,7 +116,7 @@ module.exports = function (options) {
111
116
  } else {
112
117
  try {
113
118
  file.contents = new Buffer(template.render(data));
114
- }catch(e){
119
+ } catch (e) {
115
120
  if (options.errorLogToConsole) {
116
121
  log(PLUGIN_NAME + ' ' + e);
117
122
  return cb();
@@ -130,4 +135,4 @@ module.exports = function (options) {
130
135
  }
131
136
 
132
137
  return map(modifyContents);
133
- };
138
+ }
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "author": "Simon de Turck <simon@zimmen.com> (http://www.zimmen.com)",
11
11
  "main": "./index.js",
12
+ "type": "module",
12
13
  "dependencies": {
13
14
  "fancy-log": "^1.3.2",
14
15
  "map-stream": "^0.1.0",
package/.eslintrc.js DELETED
@@ -1,35 +0,0 @@
1
- module.exports = {
2
- "env": {
3
- "browser": true,
4
- "commonjs": true,
5
- "es6": true,
6
- "jquery": true
7
- },
8
- "extends": "eslint:recommended",
9
- "parserOptions": {
10
- "sourceType": "module"
11
- },
12
- "rules": {
13
- "linebreak-style": [
14
- "error",
15
- "unix"
16
- ],
17
- "quotes": [
18
- "error",
19
- "single"
20
- ],
21
- "semi": [
22
- "error",
23
- "always"
24
- ],
25
- "no-console": [
26
- "warn", { "allow": ["warn", "error"] }
27
- ],
28
- "no-debugger": [
29
- "warn"
30
- ],
31
- "no-unused-vars": [
32
- "warn"
33
- ]
34
- }
35
- };
@@ -1,32 +0,0 @@
1
- const getConfig = require('./../lib/get-config');
2
- const generateGulpTasks = require('./../lib/generate-gulp-tasks');
3
-
4
- // Set mode globally it can be used by tasks
5
- let hasProductionArg = false;
6
-
7
- for (let i = 0; i < process.argv.length; i++) {
8
- const argValue = process.argv[i];
9
- // If build task is 'build' or '...-build' then set production mode
10
- if (argValue === 'build' || argValue.match(/^[a-z0-9-]+-build$/)) {
11
- hasProductionArg = true;
12
- }
13
- }
14
-
15
- global.production = global.production || (hasProductionArg || process.env.NODE_ENV === 'production');
16
- global.development = !global.production;
17
-
18
- // Config file
19
- let builderConfigFile = process.env.BUILDER_CONFIG_FILE || 'config/config.js';
20
-
21
- if (process.argv.indexOf('--config') !== -1) {
22
- builderConfigFile = process.argv[process.argv.indexOf('--config') + 1];
23
- } else {
24
- for (let i = 0; i < process.argv.length; i++) {
25
- if (process.argv[i].indexOf('--config=') !== -1) {
26
- builderConfigFile = process.argv[i].substr(9);
27
- }
28
- }
29
- }
30
-
31
- // Load all config files and generate gulp tasks
32
- module.exports = generateGulpTasks(getConfig.getConfig(builderConfigFile));