Files
vue-cli/packages/@vue/cli-service/lib/webpack/MovePlugin.js
2018-08-06 22:19:10 -04:00

17 lines
330 B
JavaScript

const fs = require('fs-extra')
module.exports = class MovePlugin {
constructor (from, to) {
this.from = from
this.to = to
}
apply (compiler) {
compiler.hooks.done.tap('move-plugin', () => {
if (fs.existsSync(this.from)) {
fs.moveSync(this.from, this.to, { overwrite: true })
}
})
}
}