chore: check file existence first in MovePlugin

This commit is contained in:
Evan You
2018-08-06 22:19:10 -04:00
parent ec508c7004
commit 87cc98ac1e
@@ -8,7 +8,9 @@ module.exports = class MovePlugin {
apply (compiler) {
compiler.hooks.done.tap('move-plugin', () => {
fs.moveSync(this.from, this.to, { overwrite: true })
if (fs.existsSync(this.from)) {
fs.moveSync(this.from, this.to, { overwrite: true })
}
})
}
}