weboptimizer 2.0.1248 → 2.0.1250

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 (2) hide show
  1. package/index.js +544 -560
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -57,590 +57,574 @@ process.env.UV_THREADPOOL_SIZE = '128';
57
57
  *
58
58
  * @returns Nothing.
59
59
  */
60
- var main = /*#__PURE__*/function () {
61
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(context) {
62
- var currentWorkingDirectory,
63
- commandLineArguments,
64
- webOptimizerPath,
65
- environment,
66
- _args4 = arguments;
67
- return _regenerator["default"].wrap(function _callee4$(_context4) {
68
- while (1) {
69
- switch (_context4.prev = _context4.next) {
70
- case 0:
71
- currentWorkingDirectory = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : process.cwd();
72
- commandLineArguments = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : process.argv;
73
- webOptimizerPath = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : __dirname;
74
- environment = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : eval('process.env');
75
- return _context4.abrupt("return", (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
76
- var configuration, clear;
77
- return _regenerator["default"].wrap(function _callee3$(_context3) {
78
- while (1) {
79
- switch (_context3.prev = _context3.next) {
80
- case 0:
81
- configuration = (0, _configurator.load)(context, currentWorkingDirectory, commandLineArguments, webOptimizerPath, environment);
82
- clear = _clientnode["default"].noop();
83
- _context3.prev = 2;
84
- return _context3.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
85
- var processOptions, childProcessOptions, childProcesses, processPromises, possibleArguments, closeEventHandlers, dynamicConfiguration, count, filePath, additionalArguments, _iterator, _step, file, _iterator2, _step2, _filePath, _iterator3, _step3, filePathPattern, buildConfigurations, tidiedUp, tidyUp, testModuleFilePaths, _iterator9, _step9, buildConfiguration, expression, _iterator10, _step10, _filePath6, handleTask, finished, closeHandler, _iterator14, _step14, closeEventName;
86
- return _regenerator["default"].wrap(function _callee2$(_context2) {
87
- while (1) {
88
- switch (_context2.prev = _context2.next) {
89
- case 0:
90
- // region controller
91
- processOptions = {
92
- cwd: configuration.path.context,
93
- env: environment
94
- };
95
- childProcessOptions = _objectSpread({
96
- shell: true,
97
- stdio: 'inherit'
98
- }, processOptions);
99
- childProcesses = [];
100
- processPromises = [];
101
- possibleArguments = ['build', 'build:types', 'clear', 'document', 'lint', 'preinstall', 'serve', 'test', 'test:browser', 'test:coverage', 'test:coverage:report', 'check:types'];
102
- closeEventHandlers = [];
103
- if (!(configuration.givenCommandLineArguments.length > 2)) {
104
- _context2.next = 74;
105
- break;
106
- }
107
- // region temporary save dynamically given configurations
108
- // NOTE: We need a copy of given arguments array.
109
- dynamicConfiguration = {
110
- givenCommandLineArguments: configuration.givenCommandLineArguments.slice()
111
- };
112
- if (configuration.givenCommandLineArguments.length > 3 && _clientnode["default"].stringParseEncodedObject(configuration.givenCommandLineArguments[configuration.givenCommandLineArguments.length - 1], configuration, 'configuration')) configuration.givenCommandLineArguments.pop();
113
- count = 0;
114
- filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
115
- case 11:
116
- if (!true) {
117
- _context2.next = 20;
118
- break;
119
- }
120
- filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
121
- _context2.next = 15;
122
- return _clientnode["default"].isFile(filePath);
123
- case 15:
124
- if (_context2.sent) {
125
- _context2.next = 17;
126
- break;
127
- }
128
- return _context2.abrupt("break", 20);
129
- case 17:
130
- count += 1;
131
- _context2.next = 11;
132
- break;
133
- case 20:
134
- _context2.next = 22;
135
- return (0, _promises.writeFile)(filePath, JSON.stringify(dynamicConfiguration));
136
- case 22:
137
- additionalArguments = commandLineArguments.splice(3); /// region register exit handler to tidy up
138
- clear = function clear(error) {
139
- // NOTE: Close handler have to be synchronous.
140
- if (_clientnode["default"].isFileSync(filePath)) (0, _fs.unlinkSync)(filePath);
141
- if (error) throw error;
142
- };
143
- closeEventHandlers.push(clear);
144
- /// endregion
145
- // endregion
146
- // region handle clear
147
- /*
148
- NOTE: Some tasks could depend on previously created artefacts
149
- packages so a preceding clear should not be performed in that
150
- cases.
151
- NOTE: If we have a dependency cycle we need to preserve files
152
- during pre-install phase.
153
- */
154
- if (!(!['build', 'build:types', 'preinstall', 'serve', 'test', 'test:browser', 'test:coverage', 'test:coverage:report'].includes(configuration.givenCommandLineArguments[2]) && possibleArguments.includes(configuration.givenCommandLineArguments[2]))) {
155
- _context2.next = 64;
156
- break;
157
- }
158
- if (!((0, _path.resolve)(configuration.path.target.base) === (0, _path.resolve)(configuration.path.context))) {
159
- _context2.next = 53;
160
- break;
161
- }
162
- _context2.next = 29;
163
- return _clientnode["default"].walkDirectoryRecursively(configuration.path.target.base, /*#__PURE__*/function () {
164
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
165
- var type, _file$stats;
166
- return _regenerator["default"].wrap(function _callee$(_context) {
167
- while (1) {
168
- switch (_context.prev = _context.next) {
169
- case 0:
170
- if (!_helper["default"].isFilePathInLocation(file.path, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
171
- return (0, _path.resolve)(configuration.path.context, filePath);
172
- }).filter(function (filePath) {
173
- return !configuration.path.context.startsWith(filePath);
174
- }))) {
175
- _context.next = 2;
176
- break;
177
- }
178
- return _context.abrupt("return", false);
179
- case 2:
180
- _context.t0 = _regenerator["default"].keys(configuration.buildContext.types);
181
- case 3:
182
- if ((_context.t1 = _context.t0()).done) {
183
- _context.next = 15;
184
- break;
185
- }
186
- type = _context.t1.value;
187
- if (!new RegExp(configuration.buildContext.types[type].filePathPattern).test(file.path)) {
188
- _context.next = 13;
189
- break;
190
- }
191
- if (!((_file$stats = file.stats) !== null && _file$stats !== void 0 && _file$stats.isDirectory())) {
192
- _context.next = 10;
193
- break;
194
- }
195
- _context.next = 9;
196
- return new Promise(function (resolve, reject) {
197
- return (0, _rimraf["default"])(file.path, {
198
- glob: false
199
- }, function (error) {
200
- return error ? reject(error) : resolve();
201
- });
202
- });
203
- case 9:
204
- return _context.abrupt("return", false);
205
- case 10:
206
- _context.next = 12;
207
- return (0, _promises.unlink)(file.path);
208
- case 12:
209
- return _context.abrupt("break", 15);
210
- case 13:
211
- _context.next = 3;
212
- break;
213
- case 15:
214
- case "end":
215
- return _context.stop();
216
- }
217
- }
218
- }, _callee);
219
- }));
220
- return function (_x2) {
221
- return _ref3.apply(this, arguments);
222
- };
223
- }());
224
- case 29:
225
- _context2.t0 = _createForOfIteratorHelper;
226
- _context2.next = 32;
227
- return _clientnode["default"].walkDirectoryRecursively(configuration.path.target.base, function () {
228
- return false;
229
- }, configuration.encoding);
230
- case 32:
231
- _context2.t1 = _context2.sent;
232
- _iterator = (0, _context2.t0)(_context2.t1);
233
- _context2.prev = 34;
234
- _iterator.s();
235
- case 36:
236
- if ((_step = _iterator.n()).done) {
237
- _context2.next = 43;
238
- break;
239
- }
240
- file = _step.value;
241
- if (!file.name.startsWith('npm-debug')) {
242
- _context2.next = 41;
243
- break;
244
- }
245
- _context2.next = 41;
246
- return (0, _promises.unlink)(file.path);
247
- case 41:
248
- _context2.next = 36;
249
- break;
250
- case 43:
251
- _context2.next = 48;
252
- break;
253
- case 45:
254
- _context2.prev = 45;
255
- _context2.t2 = _context2["catch"](34);
256
- _iterator.e(_context2.t2);
257
- case 48:
258
- _context2.prev = 48;
259
- _iterator.f();
260
- return _context2.finish(48);
261
- case 51:
262
- _context2.next = 55;
263
- break;
264
- case 53:
265
- _context2.next = 55;
266
- return new Promise(function (resolve, reject) {
267
- return (0, _rimraf["default"])(configuration.path.target.base, {
268
- glob: false
269
- }, function (error) {
270
- return error ? reject(error) : resolve();
271
- });
272
- });
273
- case 55:
274
- _context2.next = 57;
275
- return _clientnode["default"].isDirectory(configuration.path.apiDocumentation);
276
- case 57:
277
- if (!_context2.sent) {
278
- _context2.next = 60;
279
- break;
280
- }
281
- _context2.next = 60;
282
- return new Promise(function (resolve, reject) {
283
- return (0, _rimraf["default"])(configuration.path.apiDocumentation, {
284
- glob: false
285
- }, function (error) {
286
- return error ? reject(error) : resolve();
287
- });
288
- });
289
- case 60:
290
- _iterator2 = _createForOfIteratorHelper(configuration.path.tidyUpOnClear);
291
- try {
292
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
293
- _filePath = _step2.value;
294
- if (_filePath) if (_clientnode["default"].isFileSync(_filePath))
295
- // NOTE: Close handler have to be synchronous.
296
- (0, _fs.unlinkSync)(_filePath);else if (_clientnode["default"].isDirectorySync(_filePath)) (0, _rimraf.sync)(_filePath, {
297
- glob: false
60
+ var main = function main(context) {
61
+ try {
62
+ var currentWorkingDirectory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
63
+ var commandLineArguments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : process.argv;
64
+ var webOptimizerPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : __dirname;
65
+ var environment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : eval('process.env');
66
+ return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
67
+ var configuration, clear;
68
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
69
+ while (1) {
70
+ switch (_context3.prev = _context3.next) {
71
+ case 0:
72
+ configuration = (0, _configurator.load)(context, currentWorkingDirectory, commandLineArguments, webOptimizerPath, environment);
73
+ clear = _clientnode["default"].noop();
74
+ _context3.prev = 2;
75
+ return _context3.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
76
+ var processOptions, childProcessOptions, childProcesses, processPromises, possibleArguments, closeEventHandlers, dynamicConfiguration, count, filePath, additionalArguments, _iterator, _step, file, _iterator2, _step2, _filePath, _iterator3, _step3, filePathPattern, buildConfigurations, tidiedUp, tidyUp, testModuleFilePaths, _iterator9, _step9, buildConfiguration, expression, _iterator10, _step10, _filePath6, handleTask, finished, closeHandler, _iterator14, _step14, closeEventName;
77
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
78
+ while (1) {
79
+ switch (_context2.prev = _context2.next) {
80
+ case 0:
81
+ // region controller
82
+ processOptions = {
83
+ cwd: configuration.path.context,
84
+ env: environment
85
+ };
86
+ childProcessOptions = _objectSpread({
87
+ shell: true,
88
+ stdio: 'inherit'
89
+ }, processOptions);
90
+ childProcesses = [];
91
+ processPromises = [];
92
+ possibleArguments = ['build', 'build:types', 'clear', 'document', 'lint', 'preinstall', 'serve', 'test', 'test:browser', 'test:coverage', 'test:coverage:report', 'check:types'];
93
+ closeEventHandlers = [];
94
+ if (!(configuration.givenCommandLineArguments.length > 2)) {
95
+ _context2.next = 74;
96
+ break;
97
+ }
98
+ // region temporary save dynamically given configurations
99
+ // NOTE: We need a copy of given arguments array.
100
+ dynamicConfiguration = {
101
+ givenCommandLineArguments: configuration.givenCommandLineArguments.slice()
102
+ };
103
+ if (configuration.givenCommandLineArguments.length > 3 && _clientnode["default"].stringParseEncodedObject(configuration.givenCommandLineArguments[configuration.givenCommandLineArguments.length - 1], configuration, 'configuration')) configuration.givenCommandLineArguments.pop();
104
+ count = 0;
105
+ filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
106
+ case 11:
107
+ if (!true) {
108
+ _context2.next = 20;
109
+ break;
110
+ }
111
+ filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
112
+ _context2.next = 15;
113
+ return _clientnode["default"].isFile(filePath);
114
+ case 15:
115
+ if (_context2.sent) {
116
+ _context2.next = 17;
117
+ break;
118
+ }
119
+ return _context2.abrupt("break", 20);
120
+ case 17:
121
+ count += 1;
122
+ _context2.next = 11;
123
+ break;
124
+ case 20:
125
+ _context2.next = 22;
126
+ return (0, _promises.writeFile)(filePath, JSON.stringify(dynamicConfiguration));
127
+ case 22:
128
+ additionalArguments = commandLineArguments.splice(3); /// region register exit handler to tidy up
129
+ clear = function clear(error) {
130
+ // NOTE: Close handler have to be synchronous.
131
+ if (_clientnode["default"].isFileSync(filePath)) (0, _fs.unlinkSync)(filePath);
132
+ if (error) throw error;
133
+ };
134
+ closeEventHandlers.push(clear);
135
+ /// endregion
136
+ // endregion
137
+ // region handle clear
138
+ /*
139
+ NOTE: Some tasks could depend on previously created artefacts
140
+ packages so a preceding clear should not be performed in that
141
+ cases.
142
+ NOTE: If we have a dependency cycle we need to preserve files
143
+ during pre-install phase.
144
+ */
145
+ if (!(!['build', 'build:types', 'preinstall', 'serve', 'test', 'test:browser', 'test:coverage', 'test:coverage:report'].includes(configuration.givenCommandLineArguments[2]) && possibleArguments.includes(configuration.givenCommandLineArguments[2]))) {
146
+ _context2.next = 64;
147
+ break;
148
+ }
149
+ if (!((0, _path.resolve)(configuration.path.target.base) === (0, _path.resolve)(configuration.path.context))) {
150
+ _context2.next = 53;
151
+ break;
152
+ }
153
+ _context2.next = 29;
154
+ return _clientnode["default"].walkDirectoryRecursively(configuration.path.target.base, /*#__PURE__*/function () {
155
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
156
+ var type, _file$stats;
157
+ return _regenerator["default"].wrap(function _callee$(_context) {
158
+ while (1) {
159
+ switch (_context.prev = _context.next) {
160
+ case 0:
161
+ if (!_helper["default"].isFilePathInLocation(file.path, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
162
+ return (0, _path.resolve)(configuration.path.context, filePath);
163
+ }).filter(function (filePath) {
164
+ return !configuration.path.context.startsWith(filePath);
165
+ }))) {
166
+ _context.next = 2;
167
+ break;
168
+ }
169
+ return _context.abrupt("return", false);
170
+ case 2:
171
+ _context.t0 = _regenerator["default"].keys(configuration.buildContext.types);
172
+ case 3:
173
+ if ((_context.t1 = _context.t0()).done) {
174
+ _context.next = 15;
175
+ break;
176
+ }
177
+ type = _context.t1.value;
178
+ if (!new RegExp(configuration.buildContext.types[type].filePathPattern).test(file.path)) {
179
+ _context.next = 13;
180
+ break;
181
+ }
182
+ if (!((_file$stats = file.stats) !== null && _file$stats !== void 0 && _file$stats.isDirectory())) {
183
+ _context.next = 10;
184
+ break;
185
+ }
186
+ _context.next = 9;
187
+ return new Promise(function (resolve, reject) {
188
+ return (0, _rimraf["default"])(file.path, {
189
+ glob: false
190
+ }, function (error) {
191
+ return error ? reject(error) : resolve();
192
+ });
298
193
  });
299
- }
300
- } catch (err) {
301
- _iterator2.e(err);
302
- } finally {
303
- _iterator2.f();
304
- }
305
- _iterator3 = _createForOfIteratorHelper(configuration.path.tidyUpOnClearGlobs.pattern);
306
- try {
307
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
308
- filePathPattern = _step3.value;
309
- if (filePathPattern) (0, _rimraf.sync)(filePathPattern, configuration.path.tidyUpOnClearGlobs.options);
310
- }
311
- } catch (err) {
312
- _iterator3.e(err);
313
- } finally {
314
- _iterator3.f();
194
+ case 9:
195
+ return _context.abrupt("return", false);
196
+ case 10:
197
+ _context.next = 12;
198
+ return (0, _promises.unlink)(file.path);
199
+ case 12:
200
+ return _context.abrupt("break", 15);
201
+ case 13:
202
+ _context.next = 3;
203
+ break;
204
+ case 15:
205
+ case "end":
206
+ return _context.stop();
315
207
  }
316
- case 64:
317
- // endregion
318
- // region handle build
319
- buildConfigurations = _helper["default"].resolveBuildConfigurationFilePaths(configuration.buildContext.types, configuration.path.source.asset.base, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
320
- return (0, _path.resolve)(configuration.path.context, filePath);
321
- }).filter(function (filePath) {
322
- return !configuration.path.context.startsWith(filePath);
323
- }), configuration["package"].main.fileNames);
324
- if (['build', 'document', 'test', 'test:coverage', 'test:coverage:report'].includes(commandLineArguments[2])) {
325
- tidiedUp = false;
326
- tidyUp = function tidyUp() {
208
+ }
209
+ }, _callee);
210
+ }));
211
+ return function (_x) {
212
+ return _ref2.apply(this, arguments);
213
+ };
214
+ }());
215
+ case 29:
216
+ _context2.t0 = _createForOfIteratorHelper;
217
+ _context2.next = 32;
218
+ return _clientnode["default"].walkDirectoryRecursively(configuration.path.target.base, function () {
219
+ return false;
220
+ }, configuration.encoding);
221
+ case 32:
222
+ _context2.t1 = _context2.sent;
223
+ _iterator = (0, _context2.t0)(_context2.t1);
224
+ _context2.prev = 34;
225
+ _iterator.s();
226
+ case 36:
227
+ if ((_step = _iterator.n()).done) {
228
+ _context2.next = 43;
229
+ break;
230
+ }
231
+ file = _step.value;
232
+ if (!file.name.startsWith('npm-debug')) {
233
+ _context2.next = 41;
234
+ break;
235
+ }
236
+ _context2.next = 41;
237
+ return (0, _promises.unlink)(file.path);
238
+ case 41:
239
+ _context2.next = 36;
240
+ break;
241
+ case 43:
242
+ _context2.next = 48;
243
+ break;
244
+ case 45:
245
+ _context2.prev = 45;
246
+ _context2.t2 = _context2["catch"](34);
247
+ _iterator.e(_context2.t2);
248
+ case 48:
249
+ _context2.prev = 48;
250
+ _iterator.f();
251
+ return _context2.finish(48);
252
+ case 51:
253
+ _context2.next = 55;
254
+ break;
255
+ case 53:
256
+ _context2.next = 55;
257
+ return new Promise(function (resolve, reject) {
258
+ return (0, _rimraf["default"])(configuration.path.target.base, {
259
+ glob: false
260
+ }, function (error) {
261
+ return error ? reject(error) : resolve();
262
+ });
263
+ });
264
+ case 55:
265
+ _context2.next = 57;
266
+ return _clientnode["default"].isDirectory(configuration.path.apiDocumentation);
267
+ case 57:
268
+ if (!_context2.sent) {
269
+ _context2.next = 60;
270
+ break;
271
+ }
272
+ _context2.next = 60;
273
+ return new Promise(function (resolve, reject) {
274
+ return (0, _rimraf["default"])(configuration.path.apiDocumentation, {
275
+ glob: false
276
+ }, function (error) {
277
+ return error ? reject(error) : resolve();
278
+ });
279
+ });
280
+ case 60:
281
+ _iterator2 = _createForOfIteratorHelper(configuration.path.tidyUpOnClear);
282
+ try {
283
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
284
+ _filePath = _step2.value;
285
+ if (_filePath) if (_clientnode["default"].isFileSync(_filePath))
286
+ // NOTE: Close handler have to be synchronous.
287
+ (0, _fs.unlinkSync)(_filePath);else if (_clientnode["default"].isDirectorySync(_filePath)) (0, _rimraf.sync)(_filePath, {
288
+ glob: false
289
+ });
290
+ }
291
+ } catch (err) {
292
+ _iterator2.e(err);
293
+ } finally {
294
+ _iterator2.f();
295
+ }
296
+ _iterator3 = _createForOfIteratorHelper(configuration.path.tidyUpOnClearGlobs.pattern);
297
+ try {
298
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
299
+ filePathPattern = _step3.value;
300
+ if (filePathPattern) (0, _rimraf.sync)(filePathPattern, configuration.path.tidyUpOnClearGlobs.options);
301
+ }
302
+ } catch (err) {
303
+ _iterator3.e(err);
304
+ } finally {
305
+ _iterator3.f();
306
+ }
307
+ case 64:
308
+ // endregion
309
+ // region handle build
310
+ buildConfigurations = _helper["default"].resolveBuildConfigurationFilePaths(configuration.buildContext.types, configuration.path.source.asset.base, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
311
+ return (0, _path.resolve)(configuration.path.context, filePath);
312
+ }).filter(function (filePath) {
313
+ return !configuration.path.context.startsWith(filePath);
314
+ }), configuration["package"].main.fileNames);
315
+ if (['build', 'document', 'test', 'test:coverage', 'test:coverage:report'].includes(commandLineArguments[2])) {
316
+ tidiedUp = false;
317
+ tidyUp = function tidyUp() {
318
+ /*
319
+ Determines all none javaScript entities which have been
320
+ emitted as single module to remove.
321
+ */
322
+ if (tidiedUp) return;
323
+ tidiedUp = true;
324
+ for (var _i = 0, _Object$entries = Object.entries(configuration.injection.entry.normalized); _i < _Object$entries.length; _i++) {
325
+ var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
326
+ chunkName = _Object$entries$_i[0],
327
+ chunk = _Object$entries$_i[1];
328
+ var _iterator4 = _createForOfIteratorHelper(chunk),
329
+ _step4;
330
+ try {
331
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
332
+ var moduleID = _step4.value;
333
+ var _filePath2 = _helper["default"].determineModuleFilePath(moduleID, configuration.module.aliases, configuration.module.replacements.normal, {
334
+ file: configuration.extensions.file.internal
335
+ }, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore, configuration.module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.encoding);
336
+ var type = null;
337
+ if (_filePath2) type = _helper["default"].determineAssetType(_filePath2, configuration.buildContext.types, configuration.path);
338
+ if (typeof type === 'string' && configuration.buildContext.types[type]) {
339
+ var _filePath3 = _helper["default"].renderFilePathTemplate(_helper["default"].stripLoader(configuration.files.compose.javaScript), {
340
+ '[name]': chunkName
341
+ });
327
342
  /*
328
- Determines all none javaScript entities which have been
329
- emitted as single module to remove.
343
+ NOTE: Close handler have to be
344
+ synchronous.
330
345
  */
331
- if (tidiedUp) return;
332
- tidiedUp = true;
333
- for (var _i = 0, _Object$entries = Object.entries(configuration.injection.entry.normalized); _i < _Object$entries.length; _i++) {
334
- var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
335
- chunkName = _Object$entries$_i[0],
336
- chunk = _Object$entries$_i[1];
337
- var _iterator4 = _createForOfIteratorHelper(chunk),
338
- _step4;
339
- try {
340
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
341
- var moduleID = _step4.value;
342
- var _filePath2 = _helper["default"].determineModuleFilePath(moduleID, configuration.module.aliases, configuration.module.replacements.normal, {
343
- file: configuration.extensions.file.internal
344
- }, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore, configuration.module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.encoding);
345
- var type = null;
346
- if (_filePath2) type = _helper["default"].determineAssetType(_filePath2, configuration.buildContext.types, configuration.path);
347
- if (typeof type === 'string' && configuration.buildContext.types[type]) {
348
- var _filePath3 = _helper["default"].renderFilePathTemplate(_helper["default"].stripLoader(configuration.files.compose.javaScript), {
349
- '[name]': chunkName
350
- });
351
- /*
352
- NOTE: Close handler have to be
353
- synchronous.
354
- */
355
- if (configuration.buildContext.types[type].outputExtension === 'js' && _clientnode["default"].isFileSync(_filePath3)) (0, _fs.chmodSync)(_filePath3, '755');
356
- }
357
- }
358
- } catch (err) {
359
- _iterator4.e(err);
360
- } finally {
361
- _iterator4.f();
362
- }
363
- }
364
- var _iterator5 = _createForOfIteratorHelper(configuration.path.tidyUp),
365
- _step5;
366
- try {
367
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
368
- var _filePath4 = _step5.value;
369
- if (_filePath4) if (_clientnode["default"].isFileSync(_filePath4))
370
- // NOTE: Close handler have to be synchronous.
371
- (0, _fs.unlinkSync)(_filePath4);else if (_clientnode["default"].isDirectorySync(_filePath4)) (0, _rimraf.sync)(_filePath4, {
372
- glob: false
373
- });
374
- }
375
- } catch (err) {
376
- _iterator5.e(err);
377
- } finally {
378
- _iterator5.f();
379
- }
380
- var _iterator6 = _createForOfIteratorHelper(configuration.path.tidyUpGlobs.pattern),
381
- _step6;
382
- try {
383
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
384
- var _filePathPattern = _step6.value;
385
- if (_filePathPattern) (0, _rimraf.sync)(_filePathPattern, configuration.path.tidyUpOnClearGlobs.options);
386
- }
387
- } catch (err) {
388
- _iterator6.e(err);
389
- } finally {
390
- _iterator6.f();
391
- }
392
- };
393
- closeEventHandlers.push(tidyUp);
346
+ if (configuration.buildContext.types[type].outputExtension === 'js' && _clientnode["default"].isFileSync(_filePath3)) (0, _fs.chmodSync)(_filePath3, '755');
347
+ }
348
+ }
349
+ } catch (err) {
350
+ _iterator4.e(err);
351
+ } finally {
352
+ _iterator4.f();
353
+ }
354
+ }
355
+ var _iterator5 = _createForOfIteratorHelper(configuration.path.tidyUp),
356
+ _step5;
357
+ try {
358
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
359
+ var _filePath4 = _step5.value;
360
+ if (_filePath4) if (_clientnode["default"].isFileSync(_filePath4))
361
+ // NOTE: Close handler have to be synchronous.
362
+ (0, _fs.unlinkSync)(_filePath4);else if (_clientnode["default"].isDirectorySync(_filePath4)) (0, _rimraf.sync)(_filePath4, {
363
+ glob: false
364
+ });
365
+ }
366
+ } catch (err) {
367
+ _iterator5.e(err);
368
+ } finally {
369
+ _iterator5.f();
370
+ }
371
+ var _iterator6 = _createForOfIteratorHelper(configuration.path.tidyUpGlobs.pattern),
372
+ _step6;
373
+ try {
374
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
375
+ var _filePathPattern = _step6.value;
376
+ if (_filePathPattern) (0, _rimraf.sync)(_filePathPattern, configuration.path.tidyUpOnClearGlobs.options);
377
+ }
378
+ } catch (err) {
379
+ _iterator6.e(err);
380
+ } finally {
381
+ _iterator6.f();
382
+ }
383
+ };
384
+ closeEventHandlers.push(tidyUp);
394
385
 
395
- /*
396
- Triggers complete asset compiling and bundles them into the
397
- final productive output.
398
- */
399
- processPromises.push(new Promise(function (resolve, reject) {
400
- var commandLineArguments = (configuration.commandLine.build.arguments || []).concat(additionalArguments);
401
- console.info('Running "' + ("".concat(configuration.commandLine.build.command, " ") + commandLineArguments.join(' ')).trim() + '"');
386
+ /*
387
+ Triggers complete asset compiling and bundles them into the
388
+ final productive output.
389
+ */
390
+ processPromises.push(new Promise(function (resolve, reject) {
391
+ var commandLineArguments = (configuration.commandLine.build.arguments || []).concat(additionalArguments);
392
+ console.info('Running "' + ("".concat(configuration.commandLine.build.command, " ") + commandLineArguments.join(' ')).trim() + '"');
402
393
 
403
- /*
404
- NOTE: Take current weboptimizer's dependencies into
405
- account.
406
- */
407
- childProcessOptions.env.PATH += ":".concat(webOptimizerPath, "/node_modules/.bin");
408
- var childProcess = (0, _child_process.spawn)(configuration.commandLine.build.command, commandLineArguments, childProcessOptions);
409
- var copyAdditionalFilesAndTidyUp = function copyAdditionalFilesAndTidyUp() {
410
- var _iterator7 = _createForOfIteratorHelper(configuration.files.additionalPaths),
411
- _step7;
412
- try {
413
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
414
- var _filePath5 = _step7.value;
415
- var sourcePath = (0, _path.join)(configuration.path.source.base, _filePath5);
416
- var targetPath = (0, _path.join)(configuration.path.target.base, _filePath5);
394
+ /*
395
+ NOTE: Take current weboptimizer's dependencies into
396
+ account.
397
+ */
398
+ childProcessOptions.env.PATH += ":".concat(webOptimizerPath, "/node_modules/.bin");
399
+ var childProcess = (0, _child_process.spawn)(configuration.commandLine.build.command, commandLineArguments, childProcessOptions);
400
+ var copyAdditionalFilesAndTidyUp = function copyAdditionalFilesAndTidyUp() {
401
+ var _iterator7 = _createForOfIteratorHelper(configuration.files.additionalPaths),
402
+ _step7;
403
+ try {
404
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
405
+ var _filePath5 = _step7.value;
406
+ var sourcePath = (0, _path.join)(configuration.path.source.base, _filePath5);
407
+ var targetPath = (0, _path.join)(configuration.path.target.base, _filePath5);
417
408
 
418
- // NOTE: Close handler have to be synchronous.
419
- if (_clientnode["default"].isDirectorySync(sourcePath)) {
420
- if (_clientnode["default"].isDirectorySync(targetPath)) (0, _rimraf.sync)(targetPath, {
421
- glob: false
422
- });
423
- _clientnode["default"].copyDirectoryRecursiveSync(sourcePath, targetPath);
424
- } else if (_clientnode["default"].isFileSync(sourcePath)) _clientnode["default"].copyFileSync(sourcePath, targetPath);
425
- }
426
- } catch (err) {
427
- _iterator7.e(err);
428
- } finally {
429
- _iterator7.f();
430
- }
431
- tidyUp();
432
- };
433
- var closeHandler = _clientnode["default"].getProcessCloseHandler(resolve, reject, null, commandLineArguments[2] === 'build' ? copyAdditionalFilesAndTidyUp : tidyUp);
434
- var _iterator8 = _createForOfIteratorHelper(_clientnode.CloseEventNames),
435
- _step8;
436
- try {
437
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
438
- var closeEventName = _step8.value;
439
- childProcess.on(closeEventName, closeHandler);
440
- }
441
- } catch (err) {
442
- _iterator8.e(err);
443
- } finally {
444
- _iterator8.f();
445
- }
446
- childProcesses.push(childProcess);
447
- return childProcesses;
448
- }));
449
- // endregion
450
- // region handle pre-install
451
- } else if (configuration.library && configuration.givenCommandLineArguments[2] === 'preinstall') {
452
- // Perform all file specific preprocessing stuff.
453
- testModuleFilePaths = [];
454
- if (_clientnode["default"].isPlainObject(configuration['test:browser'].injection) && configuration['test:browser'].injection.entry) testModuleFilePaths = _helper["default"].determineModuleLocations(configuration['test:browser'].injection.entry, configuration.module.aliases, configuration.module.replacements.normal, {
455
- file: configuration.extensions.file.internal
456
- }, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore).filePaths;
457
- _iterator9 = _createForOfIteratorHelper(buildConfigurations);
458
- try {
459
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
460
- buildConfiguration = _step9.value;
461
- expression = buildConfiguration[configuration.givenCommandLineArguments[2]].trim();
462
- _iterator10 = _createForOfIteratorHelper(buildConfiguration.filePaths);
463
- try {
464
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
465
- _filePath6 = _step10.value;
466
- if (!testModuleFilePaths.includes(_filePath6)) {
467
- (function () {
468
- var evaluated = _clientnode["default"].stringEvaluate("`".concat(expression, "`"), {
469
- global: global,
470
- self: configuration,
471
- buildConfiguration: buildConfiguration,
472
- path: _path["default"],
473
- additionalArguments: additionalArguments,
474
- filePath: _filePath6
475
- });
476
- if (evaluated.error) throw new Error('Error occurred during processing given ' + "command: ".concat(evaluated.error));
477
- console.info("Running \"".concat(evaluated.result, "\""));
478
- processPromises.push(new Promise(function (resolve, reject) {
479
- return [_clientnode["default"].handleChildProcess((0, _child_process.exec)(evaluated.result, _objectSpread({
480
- encoding: configuration.encoding
481
- }, processOptions), function (error) {
482
- return error ? reject(error) : resolve({
483
- reason: 'Finished.',
484
- parameters: []
485
- });
486
- }))];
487
- }));
488
- })();
489
- }
490
- }
491
- } catch (err) {
492
- _iterator10.e(err);
493
- } finally {
494
- _iterator10.f();
495
- }
496
- }
497
- } catch (err) {
498
- _iterator9.e(err);
499
- } finally {
500
- _iterator9.f();
501
- }
409
+ // NOTE: Close handler have to be synchronous.
410
+ if (_clientnode["default"].isDirectorySync(sourcePath)) {
411
+ if (_clientnode["default"].isDirectorySync(targetPath)) (0, _rimraf.sync)(targetPath, {
412
+ glob: false
413
+ });
414
+ _clientnode["default"].copyDirectoryRecursiveSync(sourcePath, targetPath);
415
+ } else if (_clientnode["default"].isFileSync(sourcePath)) _clientnode["default"].copyFileSync(sourcePath, targetPath);
502
416
  }
503
- // endregion
504
- // region handle remaining tasks
505
- handleTask = function handleTask(type) {
506
- var tasks = Array.isArray(configuration.commandLine[type]) ? configuration.commandLine[type] : [configuration.commandLine[type]];
507
- var _iterator11 = _createForOfIteratorHelper(tasks),
508
- _step11;
509
- try {
510
- var _loop = function _loop() {
511
- var task = _step11.value;
512
- var evaluated = _clientnode["default"].stringEvaluate(Object.prototype.hasOwnProperty.call(task, 'indicator') ? task.indicator : 'true', {
417
+ } catch (err) {
418
+ _iterator7.e(err);
419
+ } finally {
420
+ _iterator7.f();
421
+ }
422
+ tidyUp();
423
+ };
424
+ var closeHandler = _clientnode["default"].getProcessCloseHandler(resolve, reject, null, commandLineArguments[2] === 'build' ? copyAdditionalFilesAndTidyUp : tidyUp);
425
+ var _iterator8 = _createForOfIteratorHelper(_clientnode.CloseEventNames),
426
+ _step8;
427
+ try {
428
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
429
+ var closeEventName = _step8.value;
430
+ childProcess.on(closeEventName, closeHandler);
431
+ }
432
+ } catch (err) {
433
+ _iterator8.e(err);
434
+ } finally {
435
+ _iterator8.f();
436
+ }
437
+ childProcesses.push(childProcess);
438
+ return childProcesses;
439
+ }));
440
+ // endregion
441
+ // region handle pre-install
442
+ } else if (configuration.library && configuration.givenCommandLineArguments[2] === 'preinstall') {
443
+ // Perform all file specific preprocessing stuff.
444
+ testModuleFilePaths = [];
445
+ if (_clientnode["default"].isPlainObject(configuration['test:browser'].injection) && configuration['test:browser'].injection.entry) testModuleFilePaths = _helper["default"].determineModuleLocations(configuration['test:browser'].injection.entry, configuration.module.aliases, configuration.module.replacements.normal, {
446
+ file: configuration.extensions.file.internal
447
+ }, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore).filePaths;
448
+ _iterator9 = _createForOfIteratorHelper(buildConfigurations);
449
+ try {
450
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
451
+ buildConfiguration = _step9.value;
452
+ expression = buildConfiguration[configuration.givenCommandLineArguments[2]].trim();
453
+ _iterator10 = _createForOfIteratorHelper(buildConfiguration.filePaths);
454
+ try {
455
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
456
+ _filePath6 = _step10.value;
457
+ if (!testModuleFilePaths.includes(_filePath6)) {
458
+ (function () {
459
+ var evaluated = _clientnode["default"].stringEvaluate("`".concat(expression, "`"), {
513
460
  global: global,
514
461
  self: configuration,
515
- path: _path["default"]
462
+ buildConfiguration: buildConfiguration,
463
+ path: _path["default"],
464
+ additionalArguments: additionalArguments,
465
+ filePath: _filePath6
516
466
  });
517
- if (evaluated.error) throw new Error('Error occurred during processing given task: ' + evaluated.error);
518
- if (evaluated.result) processPromises.push(new Promise(function (resolve, reject) {
519
- var commandLineArguments = (task.arguments || []).concat(additionalArguments);
520
- console.info('Running "' + ("".concat(task.command, " ") + commandLineArguments.join(' ')).trim() + '"');
521
- var childProcess = (0, _child_process.spawn)(task.command, commandLineArguments, childProcessOptions);
522
- var closeHandler = _clientnode["default"].getProcessCloseHandler(resolve, reject);
523
- var _iterator12 = _createForOfIteratorHelper(_clientnode.CloseEventNames),
524
- _step12;
525
- try {
526
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
527
- var closeEventName = _step12.value;
528
- childProcess.on(closeEventName, closeHandler);
529
- }
530
- } catch (err) {
531
- _iterator12.e(err);
532
- } finally {
533
- _iterator12.f();
534
- }
535
- childProcesses.push(childProcess);
536
- return childProcesses;
467
+ if (evaluated.error) throw new Error('Error occurred during processing given ' + "command: ".concat(evaluated.error));
468
+ console.info("Running \"".concat(evaluated.result, "\""));
469
+ processPromises.push(new Promise(function (resolve, reject) {
470
+ return [_clientnode["default"].handleChildProcess((0, _child_process.exec)(evaluated.result, _objectSpread({
471
+ encoding: configuration.encoding
472
+ }, processOptions), function (error) {
473
+ return error ? reject(error) : resolve({
474
+ reason: 'Finished.',
475
+ parameters: []
476
+ });
477
+ }))];
537
478
  }));
538
- };
539
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
540
- _loop();
541
- }
542
- } catch (err) {
543
- _iterator11.e(err);
544
- } finally {
545
- _iterator11.f();
479
+ })();
546
480
  }
547
- }; /// region a-/synchronous
548
- if (!['document', 'test', 'test:coverage', 'test:coverage:report'].includes(configuration.givenCommandLineArguments[2])) {
549
- _context2.next = 73;
550
- break;
551
481
  }
552
- _context2.next = 70;
553
- return Promise.all(processPromises);
554
- case 70:
555
- handleTask(configuration.givenCommandLineArguments[2]);
556
- _context2.next = 74;
557
- break;
558
- case 73:
559
- if (['build:types', 'check:types', 'lint', 'serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2])) handleTask(configuration.givenCommandLineArguments[2]);
560
- case 74:
561
- finished = false;
562
- closeHandler = function closeHandler() {
563
- if (!finished) {
564
- var _iterator13 = _createForOfIteratorHelper(closeEventHandlers),
565
- _step13;
566
- try {
567
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
568
- var closeEventHandler = _step13.value;
569
- closeEventHandler.apply(void 0, arguments);
570
- }
571
- } catch (err) {
572
- _iterator13.e(err);
573
- } finally {
574
- _iterator13.f();
575
- }
576
- }
577
- finished = true;
578
- };
579
- _iterator14 = _createForOfIteratorHelper(_clientnode.CloseEventNames);
482
+ } catch (err) {
483
+ _iterator10.e(err);
484
+ } finally {
485
+ _iterator10.f();
486
+ }
487
+ }
488
+ } catch (err) {
489
+ _iterator9.e(err);
490
+ } finally {
491
+ _iterator9.f();
492
+ }
493
+ }
494
+ // endregion
495
+ // region handle remaining tasks
496
+ handleTask = function handleTask(type) {
497
+ var tasks = Array.isArray(configuration.commandLine[type]) ? configuration.commandLine[type] : [configuration.commandLine[type]];
498
+ var _iterator11 = _createForOfIteratorHelper(tasks),
499
+ _step11;
500
+ try {
501
+ var _loop = function _loop() {
502
+ var task = _step11.value;
503
+ var evaluated = _clientnode["default"].stringEvaluate(Object.prototype.hasOwnProperty.call(task, 'indicator') ? task.indicator : 'true', {
504
+ global: global,
505
+ self: configuration,
506
+ path: _path["default"]
507
+ });
508
+ if (evaluated.error) throw new Error('Error occurred during processing given task: ' + evaluated.error);
509
+ if (evaluated.result) processPromises.push(new Promise(function (resolve, reject) {
510
+ var commandLineArguments = (task.arguments || []).concat(additionalArguments);
511
+ console.info('Running "' + ("".concat(task.command, " ") + commandLineArguments.join(' ')).trim() + '"');
512
+ var childProcess = (0, _child_process.spawn)(task.command, commandLineArguments, childProcessOptions);
513
+ var closeHandler = _clientnode["default"].getProcessCloseHandler(resolve, reject);
514
+ var _iterator12 = _createForOfIteratorHelper(_clientnode.CloseEventNames),
515
+ _step12;
580
516
  try {
581
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
582
- closeEventName = _step14.value;
583
- process.on(closeEventName, closeHandler);
517
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
518
+ var closeEventName = _step12.value;
519
+ childProcess.on(closeEventName, closeHandler);
584
520
  }
585
521
  } catch (err) {
586
- _iterator14.e(err);
522
+ _iterator12.e(err);
587
523
  } finally {
588
- _iterator14.f();
524
+ _iterator12.f();
589
525
  }
590
- if (require.main === module && (configuration.givenCommandLineArguments.length < 3 || !possibleArguments.includes(configuration.givenCommandLineArguments[2]))) console.info("Give one of \"".concat(possibleArguments.join('", "'), "\" as command ") + 'line argument. You can provide a json string as second ' + 'parameter to dynamically overwrite some configurations.\n');
591
- // endregion
592
- // region forward nested return codes
593
- _context2.prev = 79;
594
- _context2.next = 82;
595
- return Promise.all(processPromises);
596
- case 82:
597
- _context2.next = 88;
598
- break;
599
- case 84:
600
- _context2.prev = 84;
601
- _context2.t3 = _context2["catch"](79);
602
- console.error(_context2.t3);
603
- process.exit(_context2.t3.returnCode);
604
- case 88:
605
- case "end":
606
- return _context2.stop();
526
+ childProcesses.push(childProcess);
527
+ return childProcesses;
528
+ }));
529
+ };
530
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
531
+ _loop();
607
532
  }
533
+ } catch (err) {
534
+ _iterator11.e(err);
535
+ } finally {
536
+ _iterator11.f();
537
+ }
538
+ }; /// region a-/synchronous
539
+ if (!['document', 'test', 'test:coverage', 'test:coverage:report'].includes(configuration.givenCommandLineArguments[2])) {
540
+ _context2.next = 73;
541
+ break;
542
+ }
543
+ _context2.next = 70;
544
+ return Promise.all(processPromises);
545
+ case 70:
546
+ handleTask(configuration.givenCommandLineArguments[2]);
547
+ _context2.next = 74;
548
+ break;
549
+ case 73:
550
+ if (['build:types', 'check:types', 'lint', 'serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2])) handleTask(configuration.givenCommandLineArguments[2]);
551
+ case 74:
552
+ finished = false;
553
+ closeHandler = function closeHandler() {
554
+ if (!finished) {
555
+ var _iterator13 = _createForOfIteratorHelper(closeEventHandlers),
556
+ _step13;
557
+ try {
558
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
559
+ var closeEventHandler = _step13.value;
560
+ closeEventHandler.apply(void 0, arguments);
561
+ }
562
+ } catch (err) {
563
+ _iterator13.e(err);
564
+ } finally {
565
+ _iterator13.f();
566
+ }
567
+ }
568
+ finished = true;
569
+ };
570
+ _iterator14 = _createForOfIteratorHelper(_clientnode.CloseEventNames);
571
+ try {
572
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
573
+ closeEventName = _step14.value;
574
+ process.on(closeEventName, closeHandler);
608
575
  }
609
- }, _callee2, null, [[34, 45, 48, 51], [79, 84]]);
610
- })(), "t0", 4);
611
- case 4:
612
- _context3.next = 13;
613
- break;
614
- case 6:
615
- _context3.prev = 6;
616
- _context3.t1 = _context3["catch"](2);
617
- if (!configuration.debug) {
618
- _context3.next = 12;
576
+ } catch (err) {
577
+ _iterator14.e(err);
578
+ } finally {
579
+ _iterator14.f();
580
+ }
581
+ if (require.main === module && (configuration.givenCommandLineArguments.length < 3 || !possibleArguments.includes(configuration.givenCommandLineArguments[2]))) console.info("Give one of \"".concat(possibleArguments.join('", "'), "\" as command ") + 'line argument. You can provide a json string as second ' + 'parameter to dynamically overwrite some configurations.\n');
582
+ // endregion
583
+ // region forward nested return codes
584
+ _context2.prev = 79;
585
+ _context2.next = 82;
586
+ return Promise.all(processPromises);
587
+ case 82:
588
+ _context2.next = 88;
619
589
  break;
620
- }
621
- throw _context3.t1;
622
- case 12:
623
- console.error(_context3.t1);
624
- case 13:
625
- return _context3.abrupt("return", clear);
626
- case 14:
627
- case "end":
628
- return _context3.stop();
590
+ case 84:
591
+ _context2.prev = 84;
592
+ _context2.t3 = _context2["catch"](79);
593
+ console.error(_context2.t3);
594
+ process.exit(_context2.t3.returnCode);
595
+ case 88:
596
+ case "end":
597
+ return _context2.stop();
598
+ }
629
599
  }
630
- }
631
- }, _callee3, null, [[2, 6]]);
632
- }))());
633
- case 5:
634
- case "end":
635
- return _context4.stop();
600
+ }, _callee2, null, [[34, 45, 48, 51], [79, 84]]);
601
+ })(), "t0", 4);
602
+ case 4:
603
+ _context3.next = 13;
604
+ break;
605
+ case 6:
606
+ _context3.prev = 6;
607
+ _context3.t1 = _context3["catch"](2);
608
+ if (!configuration.debug) {
609
+ _context3.next = 12;
610
+ break;
611
+ }
612
+ throw _context3.t1;
613
+ case 12:
614
+ console.error(_context3.t1);
615
+ case 13:
616
+ return _context3.abrupt("return", clear);
617
+ case 14:
618
+ case "end":
619
+ return _context3.stop();
620
+ }
636
621
  }
637
- }
638
- }, _callee4);
639
- }));
640
- return function main(_x) {
641
- return _ref.apply(this, arguments);
642
- };
643
- }();
622
+ }, _callee3, null, [[2, 6]]);
623
+ }))();
624
+ } catch (e) {
625
+ return Promise.reject(e);
626
+ }
627
+ };
644
628
  if (require.main === module) void main();
645
629
  var _default = main; // region vim modline
646
630
  // vim: set tabstop=4 shiftwidth=4 expandtab:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "2.0.1248",
3
+ "version": "2.0.1250",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",