rsnext/examples/cms-wordpress/next.config.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
517 B
JavaScript
Raw Normal View History

if (!URL.canParse(process.env.WORDPRESS_API_URL)) {
throw new Error(`
Please provide a valid WordPress instance URL.
Add to your environment variables WORDPRESS_API_URL.
`);
}
const { protocol, hostname, port, pathname } = new URL(
process.env.WORDPRESS_API_URL,
);
/** @type {import('next').NextConfig} */
module.exports = {
images: {
remotePatterns: [
{
protocol: protocol.slice(0, -1),
hostname,
port,
pathname: `${pathname}/**`,
},
],
},
};