Skip to content

Commit

Permalink
Added removing of /temp
Browse files Browse the repository at this point in the history
  • Loading branch information
dyuvzhenko committed Nov 13, 2017
1 parent 41df64c commit a149be1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions webpack/clean-temp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var fs = require('fs');

var deleteFolderRecursive = function(path) {
if (fs.existsSync(path)) {
fs.readdirSync(path).forEach(function(file,index) {
var curPath = path + "/" + file;
if (fs.lstatSync(curPath).isDirectory()) { // recurse
deleteFolderRecursive(curPath);
} else { // delete file
fs.unlinkSync(curPath);
}
});
fs.rmdirSync(path);
}
};

module.exports = deleteFolderRecursive;
3 changes: 3 additions & 0 deletions webpack/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
var path = require('path');
var webpack = require('webpack');

var cleanTemp = require('./clean-temp.js');
cleanTemp(path.join(__dirname, '../temp'));

var packageJSON = require('../package.json');

var getBanner = function (compressed) {
Expand Down

0 comments on commit a149be1

Please sign in to comment.