Files
serverless-webpack/lib/cleanup.js
2017-08-01 22:00:54 +02:00

19 lines
415 B
JavaScript

'use strict';
const BbPromise = require('bluebird');
const fse = require('fs-extra');
module.exports = {
cleanup() {
const webpackOutputPath = this.webpackOutputPath;
this.options.verbose && this.serverless.cli.log(`Remove ${webpackOutputPath}`);
if (this.serverless.utils.dirExistsSync(webpackOutputPath)) {
fse.removeSync(webpackOutputPath);
}
return BbPromise.resolve();
},
};