next.js/test/e2e/app-dir/revalidate-path-with-rewrites/next.config.js
next.config.js25 lines528 B
/**
 * @type {import('next').NextConfig}
 */
module.exports = {
  rewrites: async () => {
    const isCacheComponentsEnabled =
      process.env.__NEXT_CACHE_COMPONENTS === 'true'

    return [
      {
        source: '/static',
        destination: isCacheComponentsEnabled
          ? '/cache-components/static'
          : '/legacy/static',
      },
      {
        source: '/dynamic',
        destination: isCacheComponentsEnabled
          ? '/cache-components/dynamic'
          : '/legacy/dynamic',
      },
    ]
  },
}
Quest for Codev2.0.0
/
SIGN IN