2025-08-22 17:02:49 +09:00
|
|
|
/* eslint-env node */
|
2025-10-20 16:26:47 +09:00
|
|
|
import path from "node:path";
|
|
|
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
|
|
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
2025-12-10 13:59:41 +09:00
|
|
|
const workspaceRoot = path.resolve(__dirname, "..", "..");
|
|
|
|
|
|
2025-08-20 18:02:50 +09:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
const nextConfig = {
|
2025-08-30 16:45:22 +09:00
|
|
|
output: process.env.NODE_ENV === "production" ? "standalone" : undefined,
|
2025-08-22 17:02:49 +09:00
|
|
|
|
2025-12-10 13:59:41 +09:00
|
|
|
turbopack: {
|
|
|
|
|
resolveAlias: {
|
|
|
|
|
"@customer-portal/domain": path.join(workspaceRoot, "packages/domain/dist"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
webpack(config) {
|
|
|
|
|
config.resolve.alias = {
|
|
|
|
|
...config.resolve.alias,
|
|
|
|
|
"@customer-portal/domain": path.join(workspaceRoot, "packages/domain/dist"),
|
|
|
|
|
};
|
|
|
|
|
return config;
|
|
|
|
|
},
|
2025-08-20 18:02:50 +09:00
|
|
|
|
|
|
|
|
env: {
|
|
|
|
|
NEXT_PUBLIC_API_BASE: process.env.NEXT_PUBLIC_API_BASE,
|
|
|
|
|
NEXT_PUBLIC_APP_NAME: process.env.NEXT_PUBLIC_APP_NAME,
|
|
|
|
|
NEXT_PUBLIC_APP_VERSION: process.env.NEXT_PUBLIC_APP_VERSION,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
compiler: {
|
2025-08-22 17:02:49 +09:00
|
|
|
removeConsole: process.env.NODE_ENV === "production",
|
2025-08-20 18:02:50 +09:00
|
|
|
},
|
|
|
|
|
|
2025-09-26 15:51:07 +09:00
|
|
|
experimental: {
|
2025-12-10 13:59:41 +09:00
|
|
|
optimizePackageImports: ["@heroicons/react", "@tanstack/react-query"],
|
2025-09-26 15:51:07 +09:00
|
|
|
},
|
|
|
|
|
|
2025-09-01 15:11:42 +09:00
|
|
|
typescript: { ignoreBuildErrors: false },
|
2025-08-20 18:02:50 +09:00
|
|
|
};
|
|
|
|
|
|
2025-12-11 18:47:24 +09:00
|
|
|
// Only load bundle analyzer when explicitly requested
|
|
|
|
|
let exportedConfig = nextConfig;
|
|
|
|
|
|
|
|
|
|
if (process.env.ANALYZE === "true") {
|
|
|
|
|
const bundleAnalyzer = (await import("@next/bundle-analyzer")).default;
|
|
|
|
|
exportedConfig = bundleAnalyzer({ enabled: true })(nextConfig);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default exportedConfig;
|