Disable cache on dev time in Next.js

Viewed 455

It's the first time I'm using next.js and I've experienced some issues like warnings in the console that makes me lose some time looking for the origin of them and in the end if I delete the cache and re-run next dev again, the issue simply disappear.

I expected to have any cli arg such --no-cache that we can use with Parcel or maybe any configuration inside next.config.js but there's nothing in the documentation about generally disabling cache.

I was then thinking about editing the webpack config through next.config.js like:

module.exports = {
  webpackDevMiddleware: (config) => {
    // options
  }
}

But I really don't know if this will collide with any next requirement or if it breaks good practices and can cause any future issue.

Is then possible to avoid cache during development?

By the way, can/should I try to add a --no-source-map-like modifier for production build in Next regarding the client output?

As extra information I created the app using npx create-next-app.

0 Answers
Related