[devtools] Port cache invalidation logic from turbopack to webpack (#80184)
We want to support the "reset bundler cache" button in webpack/rspack. The webpack cache is a lot more stable, but it'd be good to have as a relative baseline once we have telemetry.
We don't use a persistent cache in rspack (it's an experimental feature). The reset button is incorrectly shown there, but I think that's fine for now. Clicking it just restarts the server.
## Testing
```
pnpm turbo build build-native
```
Webpack:
```
pnpm next dev examples/basic-css
```
Rspack:
```
pnpm next dev examples/with-rspack
```
Used the reset/restart buttons in the preferences UI:
<img src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/0a007d96-d3f0-4617-a8ea-d98bdaee60dd.png" width=500/>
Watched the contents of `.next/cache/webpack` to verify the reset of the cache.