Assist_Design/apps/portal/next.config.mjs
barsa 6e3626eff0 Enhance environment configuration and update package scripts
- Added .env.development to .gitignore for better environment management.
- Introduced new dev script in package.json for streamlined application development.
- Updated Prisma migration commands in docker-entrypoint.sh for improved schema handling.
- Enhanced logging configuration in logging.module.ts to support pretty logs based on environment.
- Refactored app.config.ts to prioritize environment file loading for better configuration management.
- Removed outdated test files and configurations to clean up the project structure.
2025-12-11 18:47:24 +09:00

56 lines
1.5 KiB
JavaScript

/* eslint-env node */
import path from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const workspaceRoot = path.resolve(__dirname, "..", "..");
/** @type {import('next').NextConfig} */
const nextConfig = {
output: process.env.NODE_ENV === "production" ? "standalone" : undefined,
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;
},
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,
},
images: {
remotePatterns: [{ protocol: "https", hostname: "**" }],
},
compiler: {
removeConsole: process.env.NODE_ENV === "production",
},
experimental: {
optimizePackageImports: ["@heroicons/react", "@tanstack/react-query"],
},
typescript: { ignoreBuildErrors: false },
};
// 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;