Download next.js/examples/cms-sitecore-xmcloud/next.config.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 2.07 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-sitecore-xmcloud/next.config.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/cms-sitecore-xmcloud/next.config.js
-
curl -L -o next.config.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-sitecore-xmcloud/next.config.js
2.07 kB
| const jssConfig = require("./src/temp/config"); | |
| const { getPublicUrl } = require("@sitecore-jss/sitecore-jss-nextjs"); | |
| const plugins = require("./src/temp/next-config-plugins") || {}; | |
| const publicUrl = getPublicUrl(); | |
| /** | |
| * @type {import('next').NextConfig} | |
| */ | |
| const nextConfig = { | |
| // Set assetPrefix to our public URL | |
| assetPrefix: publicUrl, | |
| // Allow specifying a distinct distDir when concurrently running app in a container | |
| distDir: process.env.NEXTJS_DIST_DIR || ".next", | |
| // Make the same PUBLIC_URL available as an environment variable on the client bundle | |
| env: { | |
| PUBLIC_URL: publicUrl, | |
| }, | |
| i18n: { | |
| // These are all the locales you want to support in your application. | |
| // These should generally match (or at least be a subset of) those in Sitecore. | |
| locales: ["en"], | |
| // This is the locale that will be used when visiting a non-locale | |
| // prefixed path e.g. `/styleguide`. | |
| defaultLocale: jssConfig.defaultLanguage, | |
| }, | |
| // Enable React Strict Mode | |
| reactStrictMode: true, | |
| async rewrites() { | |
| // When in connected mode we want to proxy Sitecore paths off to Sitecore | |
| return [ | |
| // API endpoints | |
| { | |
| source: "/sitecore/api/:path*", | |
| destination: `${jssConfig.sitecoreApiHost}/sitecore/api/:path*`, | |
| }, | |
| // media items | |
| { | |
| source: "/-/:path*", | |
| destination: `${jssConfig.sitecoreApiHost}/-/:path*`, | |
| }, | |
| // visitor identification | |
| { | |
| source: "/layouts/system/:path*", | |
| destination: `${jssConfig.sitecoreApiHost}/layouts/system/:path*`, | |
| }, | |
| // healthz check | |
| { | |
| source: "/healthz", | |
| destination: "/api/healthz", | |
| }, | |
| // rewrite for Sitecore service pages | |
| { | |
| source: "/sitecore/service/:path*", | |
| destination: `${jssConfig.sitecoreApiHost}/sitecore/service/:path*`, | |
| }, | |
| ]; | |
| }, | |
| }; | |
| module.exports = () => { | |
| // Run the base config through any configured plugins | |
| return Object.values(plugins).reduce( | |
| (acc, plugin) => plugin(acc), | |
| nextConfig, | |
| ); | |
| }; | |