mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-01 11:14:07 +03:00
add clean to build
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = ({ paths = [], verbose = false } = {}) => {
|
||||
let cleaned = false;
|
||||
return {
|
||||
name: 'clean',
|
||||
async buildStart() {
|
||||
if (!cleaned) {
|
||||
paths.forEach((currPath) => {
|
||||
const resolvedPath = path.resolve(currPath);
|
||||
if (fs.existsSync(resolvedPath)) {
|
||||
if (verbose) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Clean: ${resolvedPath}`);
|
||||
}
|
||||
fs.rmSync(resolvedPath, { recursive: true });
|
||||
}
|
||||
});
|
||||
cleaned = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user