diff --git a/lib/build.js b/lib/build.js index a904aa7ba0..149f9f93a0 100644 --- a/lib/build.js +++ b/lib/build.js @@ -21,6 +21,9 @@ module.exports = async function build (sourceDir, cliOptions = {}) { } const { outDir } = options + if (path.resolve() === outDir) { + return console.error(chalk.red('Unexpected option: outDir cannot be set to the current working directory.\n')) + } await fs.remove(outDir) let clientConfig = createClientConfig(options, cliOptions).toConfig()