Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Contentstack
Copyright (c) 2026 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
91 changes: 47 additions & 44 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,

// Environment variables available at build time
env: {
CONTENTSTACK_API_KEY: process.env.CONTENTSTACK_API_KEY,
CONTENTSTACK_DELIVERY_TOKEN: process.env.CONTENTSTACK_DELIVERY_TOKEN,
CONTENTSTACK_BRANCH: process.env.CONTENTSTACK_BRANCH || 'main',
CONTENTSTACK_ENVIRONMENT: process.env.CONTENTSTACK_ENVIRONMENT,
CONTENTSTACK_APP_HOST: process.env.CONTENTSTACK_APP_HOST,
CONTENTSTACK_PREVIEW_HOST: process.env.CONTENTSTACK_PREVIEW_HOST,
CONTENTSTACK_PREVIEW_TOKEN: process.env.CONTENTSTACK_PREVIEW_TOKEN,
CONTENTSTACK_LIVE_EDIT_TAGS: process.env.CONTENTSTACK_LIVE_EDIT_TAGS,
CONTENTSTACK_API_HOST: process.env.CONTENTSTACK_API_HOST,
},

// Server external packages for Node.js modules
serverExternalPackages: ['contentstack', '@contentstack/utils'],

// Image configuration
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'images.contentstack.io',
},
{
protocol: 'https',
hostname: '*.contentstack.io',
},
],
},

// Webpack config for client-side Node.js module fallbacks
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
os: false,
};
}
return config;
},
reactStrictMode: true,

// Force Next.js to use Webpack instead of Turbopack
turbopack: false,

// Environment variables
env: {
CONTENTSTACK_API_KEY: process.env.CONTENTSTACK_API_KEY,
CONTENTSTACK_DELIVERY_TOKEN: process.env.CONTENTSTACK_DELIVERY_TOKEN,
CONTENTSTACK_BRANCH: process.env.CONTENTSTACK_BRANCH || 'main',
CONTENTSTACK_ENVIRONMENT: process.env.CONTENTSTACK_ENVIRONMENT,
CONTENTSTACK_APP_HOST: process.env.CONTENTSTACK_APP_HOST,
CONTENTSTACK_PREVIEW_HOST: process.env.CONTENTSTACK_PREVIEW_HOST,
CONTENTSTACK_PREVIEW_TOKEN: process.env.CONTENTSTACK_PREVIEW_TOKEN,
CONTENTSTACK_LIVE_EDIT_TAGS: process.env.CONTENTSTACK_LIVE_EDIT_TAGS,
CONTENTSTACK_API_HOST: process.env.CONTENTSTACK_API_HOST,
},

// Server external packages
serverExternalPackages: ['contentstack', '@contentstack/utils'],

// Image config
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'images.contentstack.io',
},
{
protocol: 'https',
hostname: '*.contentstack.io',
},
],
},

// Webpack adjustments
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
os: false,
};
}
return config;
},
};

export default nextConfig;
Loading