-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathnext.config.js
33 lines (29 loc) · 1023 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/** @type {import('next').NextConfig} */
const nextConfig = {
// Disable all development indicators
devIndicators: {
buildActivity: false,
staticPageGenerationInfo: false,
},
// Determine which file extensions to use based on SAAS enablement
pageExtensions: (() => {
const isSaasEnabled =
process.env.NEXT_PUBLIC_ENABLE_SAAS_FEATURES === "true";
// Base extensions
const baseExtensions = ["js", "jsx", "ts", "tsx"];
if (isSaasEnabled) {
// For SAAS version, include .saas. files and exclude .open. files
return [
...baseExtensions.map((ext) => ext),
...baseExtensions.map((ext) => `saas.${ext}`),
].filter((ext) => !ext.includes(".open."));
} else {
// For open source version, include .open. files and exclude .saas. files
return [
...baseExtensions.map((ext) => ext),
...baseExtensions.map((ext) => `open.${ext}`),
].filter((ext) => !ext.includes(".saas."));
}
})(),
};
module.exports = nextConfig;