weboptimizer 2.0.1263 → 2.0.1264
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/browser.js +142 -146
- package/configurator.js +1 -1
- package/ejsLoader.js +1 -3
- package/helper.js +4 -6
- package/index.js +571 -546
- package/package.json +1 -1
- package/webpackConfigurator.js +85 -95
package/browser.js
CHANGED
|
@@ -28,7 +28,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
28
28
|
var _clientnode = _interopRequireWildcard(require("clientnode"));
|
|
29
29
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
30
30
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
31
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
34
34
|
// endregion
|
|
@@ -54,136 +54,134 @@ if (typeof TARGET_TECHNOLOGY === 'undefined' || TARGET_TECHNOLOGY === 'node')
|
|
|
54
54
|
(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
55
55
|
var _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, JSDOM, VirtualConsoleImplementation, path, virtualConsole, _iterator, _step, name, render, filePath, ejsLoader, content;
|
|
56
56
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
57
|
-
while (1) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
virtualConsole.on(name, console[name].bind(console));
|
|
79
|
-
}
|
|
80
|
-
} catch (err) {
|
|
81
|
-
_iterator.e(err);
|
|
82
|
-
} finally {
|
|
83
|
-
_iterator.f();
|
|
57
|
+
while (1) switch (_context.prev = _context.next) {
|
|
58
|
+
case 0:
|
|
59
|
+
_context.next = 2;
|
|
60
|
+
return Promise.all([Promise.resolve().then(function () {
|
|
61
|
+
return _interopRequireWildcard(require('jsdom'));
|
|
62
|
+
}), Promise.resolve().then(function () {
|
|
63
|
+
return _interopRequireWildcard(require('path'));
|
|
64
|
+
})]);
|
|
65
|
+
case 2:
|
|
66
|
+
_yield$Promise$all = _context.sent;
|
|
67
|
+
_yield$Promise$all2 = (0, _slicedToArray2["default"])(_yield$Promise$all, 2);
|
|
68
|
+
_yield$Promise$all2$ = _yield$Promise$all2[0];
|
|
69
|
+
JSDOM = _yield$Promise$all2$.JSDOM;
|
|
70
|
+
VirtualConsoleImplementation = _yield$Promise$all2$.VirtualConsole;
|
|
71
|
+
path = _yield$Promise$all2[1];
|
|
72
|
+
virtualConsole = new VirtualConsoleImplementation();
|
|
73
|
+
_iterator = _createForOfIteratorHelper(_clientnode.ConsoleOutputMethods);
|
|
74
|
+
try {
|
|
75
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
76
|
+
name = _step.value;
|
|
77
|
+
virtualConsole.on(name, console[name].bind(console));
|
|
84
78
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
79
|
+
} catch (err) {
|
|
80
|
+
_iterator.e(err);
|
|
81
|
+
} finally {
|
|
82
|
+
_iterator.f();
|
|
83
|
+
}
|
|
84
|
+
virtualConsole.on('error', function (error) {
|
|
85
|
+
if (!browser.debug && ['XMLHttpRequest', 'resource loading'].includes(error.type)) console.warn("Loading resource failed: ".concat(error.toString(), "."));else console.error(error.stack, error.detail);
|
|
86
|
+
});
|
|
87
|
+
render = function render(template) {
|
|
88
|
+
browser.DOM = JSDOM;
|
|
89
|
+
browser.initialized = true;
|
|
90
|
+
browser.instance = new browser.DOM(template, {
|
|
91
|
+
beforeParse: function beforeParse(window) {
|
|
92
|
+
var _global$window;
|
|
93
|
+
// We want to use it in a polymorphic way.
|
|
94
|
+
browser.window = (_global$window = global.window) !== null && _global$window !== void 0 ? _global$window : window;
|
|
95
|
+
window.document.addEventListener('DOMContentLoaded', function () {
|
|
96
|
+
/*
|
|
97
|
+
Move template results into global
|
|
98
|
+
pre-defined dom.
|
|
99
|
+
*/
|
|
100
|
+
if (global.window) {
|
|
101
|
+
var _iterator2 = _createForOfIteratorHelper(['head', 'body']),
|
|
102
|
+
_step2;
|
|
103
|
+
try {
|
|
104
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
105
|
+
var type = _step2.value;
|
|
106
|
+
global.window.document[type].innerHTML = window.document[type].innerHTML;
|
|
113
107
|
}
|
|
108
|
+
} catch (err) {
|
|
109
|
+
_iterator2.e(err);
|
|
110
|
+
} finally {
|
|
111
|
+
_iterator2.f();
|
|
114
112
|
}
|
|
115
|
-
browser.domContentLoaded = true;
|
|
116
|
-
});
|
|
117
|
-
window.addEventListener('load', function () {
|
|
118
|
-
/*
|
|
119
|
-
NOTE: Maybe we have miss the "DOMContentLoaded"
|
|
120
|
-
event caused by a race condition.
|
|
121
|
-
*/
|
|
122
|
-
browser.domContentLoaded = browser.windowLoaded = true;
|
|
123
|
-
});
|
|
124
|
-
var _iterator3 = _createForOfIteratorHelper(onCreatedListener),
|
|
125
|
-
_step3;
|
|
126
|
-
try {
|
|
127
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
128
|
-
var callback = _step3.value;
|
|
129
|
-
callback();
|
|
130
|
-
}
|
|
131
|
-
} catch (err) {
|
|
132
|
-
_iterator3.e(err);
|
|
133
|
-
} finally {
|
|
134
|
-
_iterator3.f();
|
|
135
113
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
case 20:
|
|
163
|
-
_context.next = 22;
|
|
164
|
-
return _context.sent.promises.readFile(filePath, {
|
|
165
|
-
encoding: 'utf-8'
|
|
114
|
+
browser.domContentLoaded = true;
|
|
115
|
+
});
|
|
116
|
+
window.addEventListener('load', function () {
|
|
117
|
+
/*
|
|
118
|
+
NOTE: Maybe we have miss the "DOMContentLoaded"
|
|
119
|
+
event caused by a race condition.
|
|
120
|
+
*/
|
|
121
|
+
browser.domContentLoaded = browser.windowLoaded = true;
|
|
122
|
+
});
|
|
123
|
+
var _iterator3 = _createForOfIteratorHelper(onCreatedListener),
|
|
124
|
+
_step3;
|
|
125
|
+
try {
|
|
126
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
127
|
+
var callback = _step3.value;
|
|
128
|
+
callback();
|
|
129
|
+
}
|
|
130
|
+
} catch (err) {
|
|
131
|
+
_iterator3.e(err);
|
|
132
|
+
} finally {
|
|
133
|
+
_iterator3.f();
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
resources: 'usable',
|
|
137
|
+
runScripts: 'dangerously',
|
|
138
|
+
url: 'http://localhost',
|
|
139
|
+
virtualConsole: virtualConsole
|
|
166
140
|
});
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
resourcePath: filePath
|
|
171
|
-
})(content));
|
|
172
|
-
_context.next = 31;
|
|
141
|
+
};
|
|
142
|
+
if (!(typeof NAME === 'undefined' || NAME === 'webOptimizer')) {
|
|
143
|
+
_context.next = 26;
|
|
173
144
|
break;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
145
|
+
}
|
|
146
|
+
filePath = path.join(__dirname, 'index.html.ejs');
|
|
147
|
+
/*
|
|
148
|
+
NOTE: We load dependencies now to avoid having file imports
|
|
149
|
+
after test runner has finished to isolate the environment.
|
|
150
|
+
*/
|
|
151
|
+
_context.next = 17;
|
|
152
|
+
return Promise.resolve().then(function () {
|
|
153
|
+
return _interopRequireWildcard(require('./ejsLoader'));
|
|
154
|
+
});
|
|
155
|
+
case 17:
|
|
156
|
+
ejsLoader = _context.sent["default"];
|
|
157
|
+
_context.next = 20;
|
|
158
|
+
return Promise.resolve().then(function () {
|
|
159
|
+
return _interopRequireWildcard(require('fs'));
|
|
160
|
+
});
|
|
161
|
+
case 20:
|
|
162
|
+
_context.next = 22;
|
|
163
|
+
return _context.sent.promises.readFile(filePath, {
|
|
164
|
+
encoding: 'utf-8'
|
|
165
|
+
});
|
|
166
|
+
case 22:
|
|
167
|
+
content = _context.sent;
|
|
168
|
+
render(ejsLoader.bind({
|
|
169
|
+
resourcePath: filePath
|
|
170
|
+
})(content));
|
|
171
|
+
_context.next = 31;
|
|
172
|
+
break;
|
|
173
|
+
case 26:
|
|
174
|
+
_context.t0 = render;
|
|
175
|
+
_context.next = 29;
|
|
176
|
+
return Promise.resolve().then(function () {
|
|
177
|
+
return _interopRequireWildcard(require('webOptimizerDefaultTemplateFilePath'));
|
|
178
|
+
});
|
|
179
|
+
case 29:
|
|
180
|
+
_context.t1 = _context.sent;
|
|
181
|
+
(0, _context.t0)(_context.t1);
|
|
182
|
+
case 31:
|
|
183
|
+
case "end":
|
|
184
|
+
return _context.stop();
|
|
187
185
|
}
|
|
188
186
|
}, _callee);
|
|
189
187
|
}))()["catch"](console.error);else {
|
|
@@ -226,27 +224,25 @@ var getInitializedBrowser = /*#__PURE__*/function () {
|
|
|
226
224
|
wrappedCallback,
|
|
227
225
|
_args2 = arguments;
|
|
228
226
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
229
|
-
while (1) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return _context2.stop();
|
|
249
|
-
}
|
|
227
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
228
|
+
case 0:
|
|
229
|
+
replaceWindow = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : true;
|
|
230
|
+
promise = new Promise(function (resolve) {
|
|
231
|
+
resolvePromise = resolve;
|
|
232
|
+
});
|
|
233
|
+
/*
|
|
234
|
+
NOTE: We have to define window globally before anything is loaded to
|
|
235
|
+
ensure that all future instances share the same window object.
|
|
236
|
+
*/
|
|
237
|
+
wrappedCallback = function wrappedCallback() {
|
|
238
|
+
if (replaceWindow && typeof global !== 'undefined' && global !== browser.window) global.window = browser.window;
|
|
239
|
+
resolvePromise(browser);
|
|
240
|
+
};
|
|
241
|
+
if (browser.initialized) wrappedCallback();else onCreatedListener.push(wrappedCallback);
|
|
242
|
+
return _context2.abrupt("return", promise);
|
|
243
|
+
case 5:
|
|
244
|
+
case "end":
|
|
245
|
+
return _context2.stop();
|
|
250
246
|
}
|
|
251
247
|
}, _callee2);
|
|
252
248
|
}));
|
package/configurator.js
CHANGED
|
@@ -34,7 +34,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
36
36
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
37
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
37
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
38
38
|
// endregion
|
|
39
39
|
var loadedConfiguration = null;
|
|
40
40
|
/**
|
package/ejsLoader.js
CHANGED
|
@@ -190,9 +190,7 @@ var loader = function loader(source) {
|
|
|
190
190
|
*/
|
|
191
191
|
if (options.strict || !options._with) {
|
|
192
192
|
var localsName = options.localsName || 'locals';
|
|
193
|
-
while (scopeNames.includes(localsName))
|
|
194
|
-
localsName = "_".concat(localsName);
|
|
195
|
-
}
|
|
193
|
+
while (scopeNames.includes(localsName)) localsName = "_".concat(localsName);
|
|
196
194
|
|
|
197
195
|
/* eslint-disable @typescript-eslint/no-implied-eval */
|
|
198
196
|
result = (0, _construct2["default"])(Function, (0, _toConsumableArray2["default"])(scopeNames).concat([localsName, "return ".concat(result.toString(), "(") + "".concat(localsName, ",").concat(localsName, ".escapeFn,include,") + "".concat(localsName, ".rethrow)")]));
|
package/helper.js
CHANGED
|
@@ -35,7 +35,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
35
35
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
36
36
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
37
37
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
38
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
38
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
39
39
|
// endregion
|
|
40
40
|
// region constants
|
|
41
41
|
var KNOWN_FILE_EXTENSIONS = ['js', 'ts', 'json', 'css', 'eot', 'gif', 'html', 'ico', 'jpg', 'png', 'ejs', 'svg', 'ttf', 'woff', '.woff2'];
|
|
@@ -331,11 +331,9 @@ var Helper = /*#__PURE__*/function () {
|
|
|
331
331
|
key: "determineAssetType",
|
|
332
332
|
value: function determineAssetType(filePath, buildConfiguration, paths) {
|
|
333
333
|
var result = null;
|
|
334
|
-
for (var type in buildConfiguration) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
break;
|
|
338
|
-
}
|
|
334
|
+
for (var type in buildConfiguration) if ((0, _path.extname)(filePath) === ".".concat(buildConfiguration[type].extension)) {
|
|
335
|
+
result = type;
|
|
336
|
+
break;
|
|
339
337
|
}
|
|
340
338
|
if (!result) for (var _i3 = 0, _arr = [paths.source, paths.target]; _i3 < _arr.length; _i3++) {
|
|
341
339
|
var _type = _arr[_i3];
|