"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const clean_webpack_plugin_1 = __importDefault(require("clean-webpack-plugin"));
const webpack_merge_1 = __importDefault(require("webpack-merge"));
/**
 * Clean the directory before a fresh build
 * @param config
 * @param builder
 */
const CleanBuildDir = () => (config, builder) => {
    // if (!config.output || !config.output.path) {
    // 	return config;
    // }
    return webpack_merge_1.default(config, {
        plugins: [
            new clean_webpack_plugin_1.default(builder.configs.outputPath)
        ]
    });
};
exports.default = CleanBuildDir;
//# sourceMappingURL=CleanBuildDir.js.map