To discover all available paths on websites built with Next.js, you can use the following commands in the browser's console:
Steps:
- Open the website in your browser.
- Access the Developer Tools (usually F12 or right-click and select "Inspect").
- Navigate to the Console tab.
- Enter the following commands:
console.log(__BUILD_MANIFEST.sortedPages);
This will display an array of all the sorted pages available in the Next.js application.
To View Each Path on a New Line:
If you prefer to see each path on a new line, use:
console.log(__BUILD_MANIFEST.sortedPages.join('\n'));
This will print each page path on a separate line, making it easier to read and analyze the available routes in the Next.js application.