isaacs/rimraf

`rimraf` as `devDependency` requires non-dev dependency `glob`

joeyaurel opened this issue · 2 comments

Problem

In my setup I want to use rimraf only as a devDependency since I only want to use it in my build environment when removing a dist/ directory to then re-build into that directory.

Problem is that rimraf requires glob as a non-dev dependency which won't be installed when only dev dependencies should be installed for the build environment (via npm install --only=development or when NODE_ENV is set to development).

Possible solution

Is there any chance to make glob optional (#181) or also install it as a dev dependency, when rimraf is getting installed as a dev dependency? (Don't actually know the second is even possible.)

Alternatives

  1. Installing rimraf as a global non-dev dependency before installing only dev dependencies while having rimraf installed as a non-dev dependency within the package.json file
  2. Installing ALL dependencies in the build environment (which is not want I want).
  3. rm -rf

Did you get any solution to this?

Installed this in 2022. Works as a dev dependency out of the box