UNPKG

kuyin-webpack-plugins

Version:

custom webpack, enhanced-resolve plugins

19 lines (18 loc) 578 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const fs_extra_1 = tslib_1.__importDefault(require("fs-extra")); class MovePlugin { constructor(options) { this.options = options; } apply(compiler) { const { from, to } = this.options; compiler.hooks.done.tap('move-plugin', () => { if (fs_extra_1.default.existsSync(from)) { fs_extra_1.default.moveSync(from, to, { overwrite: true }); } }); } } exports.MovePlugin = MovePlugin;