Add a `netlify clean` command
Is your feature request related to a problem? Please describe.
In development I often need to clean the cache, and it's annoying having to do this manually.
Describe the solution you'd like
A netlify clean command that clears the Nelify cache, as well as (possibly optionally) the publish directory. Better still would be a way for frameworks to declare their own clean commands too in framework-info.
Describe alternatives you've considered
Doing it manually
Can you submit a pull request?
Yes
Thanks @ascorbic, what do you mean by Netlify cache?
Is it everything under <project-dir>/.netlify except the state.json file?
For the publish directory, since it's a valid use case to have versioned controlled files (e.g. _redirects), we either need to detect when it's safe to clean it, or provide an opt-in flag.
Also, do you think we need the following:
-
ntl clean -
ntl build --clean -
ntl deploy --build --clean -
ntl dev --clean
Where if we detect a framework we run the specific framework clean command?
what do you mean by Netlify cache? Is it everything under
/.netlify except the state.json file?
@erezrokah Yes, exactly that.
I think it's simplest to just have 1. Clears .netlify cache by default, and runs framework-specific clean commands if implemented, and/or a command in the toml