weboptimizer 2.0.1312 → 2.0.1313
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/index.js +9 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var _fs = require("fs");
|
|
|
34
34
|
var _promises = require("fs/promises");
|
|
35
35
|
var _globAll = require("glob-all");
|
|
36
36
|
var _path = _interopRequireWildcard(require("path"));
|
|
37
|
-
var _rimraf =
|
|
37
|
+
var _rimraf = require("rimraf");
|
|
38
38
|
var _configurator = require("./configurator");
|
|
39
39
|
var _helper = _interopRequireDefault(require("./helper"));
|
|
40
40
|
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); }
|
|
@@ -177,7 +177,7 @@ var main = function main(context) {
|
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
_context.next = 9;
|
|
180
|
-
return (0, _rimraf
|
|
180
|
+
return (0, _rimraf.rimraf)(file.path);
|
|
181
181
|
case 9:
|
|
182
182
|
return _context.abrupt("return", false);
|
|
183
183
|
case 10:
|
|
@@ -240,7 +240,7 @@ var main = function main(context) {
|
|
|
240
240
|
break;
|
|
241
241
|
case 56:
|
|
242
242
|
_context3.next = 58;
|
|
243
|
-
return (0, _rimraf
|
|
243
|
+
return (0, _rimraf.rimraf)(configuration.path.target.base);
|
|
244
244
|
case 58:
|
|
245
245
|
_context3.next = 60;
|
|
246
246
|
return _clientnode["default"].isDirectory(configuration.path.apiDocumentation);
|
|
@@ -250,7 +250,7 @@ var main = function main(context) {
|
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
252
|
_context3.next = 63;
|
|
253
|
-
return (0, _rimraf
|
|
253
|
+
return (0, _rimraf.rimraf)(configuration.path.apiDocumentation);
|
|
254
254
|
case 63:
|
|
255
255
|
_iterator2 = _createForOfIteratorHelper(configuration.path.tidyUpOnClear);
|
|
256
256
|
try {
|
|
@@ -258,14 +258,14 @@ var main = function main(context) {
|
|
|
258
258
|
_filePath = _step2.value;
|
|
259
259
|
if (_filePath) if (_clientnode["default"].isFileSync(_filePath))
|
|
260
260
|
// NOTE: Close handler have to be synchronous.
|
|
261
|
-
(0, _fs.unlinkSync)(_filePath);else if (_clientnode["default"].isDirectorySync(_filePath)) (0, _rimraf.
|
|
261
|
+
(0, _fs.unlinkSync)(_filePath);else if (_clientnode["default"].isDirectorySync(_filePath)) (0, _rimraf.rimrafSync)(_filePath);
|
|
262
262
|
}
|
|
263
263
|
} catch (err) {
|
|
264
264
|
_iterator2.e(err);
|
|
265
265
|
} finally {
|
|
266
266
|
_iterator2.f();
|
|
267
267
|
}
|
|
268
|
-
(0, _rimraf.
|
|
268
|
+
(0, _rimraf.rimrafSync)((0, _globAll.sync)(configuration.path.tidyUpOnClearGlobs));
|
|
269
269
|
case 66:
|
|
270
270
|
// endregion
|
|
271
271
|
// region handle build
|
|
@@ -324,14 +324,14 @@ var main = function main(context) {
|
|
|
324
324
|
var _filePath4 = _step4.value;
|
|
325
325
|
if (_filePath4) if (_clientnode["default"].isFileSync(_filePath4))
|
|
326
326
|
// NOTE: Close handler have to be synchronous.
|
|
327
|
-
(0, _fs.unlinkSync)(_filePath4);else if (_clientnode["default"].isDirectorySync(_filePath4)) (0, _rimraf.
|
|
327
|
+
(0, _fs.unlinkSync)(_filePath4);else if (_clientnode["default"].isDirectorySync(_filePath4)) (0, _rimraf.rimrafSync)(_filePath4);
|
|
328
328
|
}
|
|
329
329
|
} catch (err) {
|
|
330
330
|
_iterator4.e(err);
|
|
331
331
|
} finally {
|
|
332
332
|
_iterator4.f();
|
|
333
333
|
}
|
|
334
|
-
(0, _rimraf.
|
|
334
|
+
(0, _rimraf.rimrafSync)((0, _globAll.sync)(configuration.path.tidyUpGlobs));
|
|
335
335
|
};
|
|
336
336
|
closeEventHandlers.push(tidyUp);
|
|
337
337
|
|
|
@@ -360,7 +360,7 @@ var main = function main(context) {
|
|
|
360
360
|
|
|
361
361
|
// NOTE: Close handler have to be synchronous.
|
|
362
362
|
if (_clientnode["default"].isDirectorySync(sourcePath)) {
|
|
363
|
-
if (_clientnode["default"].isDirectorySync(targetPath)) (0, _rimraf.
|
|
363
|
+
if (_clientnode["default"].isDirectorySync(targetPath)) (0, _rimraf.rimrafSync)(targetPath);
|
|
364
364
|
_clientnode["default"].copyDirectoryRecursiveSync(sourcePath, targetPath);
|
|
365
365
|
} else if (_clientnode["default"].isFileSync(sourcePath)) _clientnode["default"].copyFileSync(sourcePath, targetPath);
|
|
366
366
|
}
|