Skip to content

deleteOutputPath option should delete the contents and not the directory itselfΒ #10856

@sarveshraj

Description

@sarveshraj

Current Behavior

@nrwl/node:webpack executor deletes the output folder before execution. This is due to deleteOutputPath option being set to true by default.

Any target using @nrwl/workspace:run-commands executor with the cwd option set to the output path and one of the commands set to the target using @nrwl/node:webpack executor fails. The failure is because @nrwl/workspace:run-commands tries to run commands in a deleted folder.

Expected Behavior

I am proposing that the deleteOutputPath option delete the contents of the output folder and not the folder itself.

Steps to Reproduce

Reproduced in nrwl/nx-examples#207
Steps mentioned in the PR itself

Failure Logs

Environment

 >  NX   Report complete - copy this into the issue template

   Node : 14.18.1
   OS   : darwin x64
   yarn : 1.22.19
   
   nx : 14.3.1
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.3.1
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.3.1
   @nrwl/eslint-plugin-nx : 14.3.1
   @nrwl/express : Not Found
   @nrwl/jest : 14.3.1
   @nrwl/js : 14.3.1
   @nrwl/linter : 14.3.1
   @nrwl/nest : Not Found
   @nrwl/next : 14.3.1
   @nrwl/node : 14.3.1
   @nrwl/nx-cloud : 14.1.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 14.3.1
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.3.1
   @nrwl/web : 14.3.1
   @nrwl/workspace : 14.3.1
   typescript : 4.7.3
   ---------------------------------------
   Community plugins:
         @nxext/svelte: 13.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions