diff options
| author | Saumit <justsaumit@protonmail.com> | 2025-09-27 02:14:26 +0530 |
|---|---|---|
| committer | Saumit <justsaumit@protonmail.com> | 2025-09-27 02:14:26 +0530 |
| commit | 82e03978b89938219958032efb1448cc76baa181 (patch) | |
| tree | 626f3e54d52ecd49be0ed3bee30abacc0453d081 /src/frontend/next.config.js | |
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'src/frontend/next.config.js')
| -rwxr-xr-x | src/frontend/next.config.js | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/frontend/next.config.js b/src/frontend/next.config.js new file mode 100755 index 0000000..49de52a --- /dev/null +++ b/src/frontend/next.config.js @@ -0,0 +1,65 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +/** @type {import('next').NextConfig} */ + +const dotEnv = require('dotenv'); +const dotenvExpand = require('dotenv-expand'); +const { resolve } = require('path'); + +const myEnv = dotEnv.config({ + path: resolve(__dirname, '../../.env'), +}); +dotenvExpand.expand(myEnv); + +const { + AD_ADDR = '', + CART_ADDR = '', + CHECKOUT_ADDR = '', + CURRENCY_ADDR = '', + PRODUCT_CATALOG_ADDR = '', + RECOMMENDATION_ADDR = '', + SHIPPING_ADDR = '', + ENV_PLATFORM = '', + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT = '', + OTEL_SERVICE_NAME = 'frontend', + PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT = '', +} = process.env; + +const nextConfig = { + reactStrictMode: true, + output: 'standalone', + compiler: { + styledComponents: true, + }, + webpack: (config, { isServer }) => { + if (!isServer) { + config.resolve.fallback.http2 = false; + config.resolve.fallback.tls = false; + config.resolve.fallback.net = false; + config.resolve.fallback.dns = false; + config.resolve.fallback.fs = false; + } + + return config; + }, + env: { + AD_ADDR, + CART_ADDR, + CHECKOUT_ADDR, + CURRENCY_ADDR, + PRODUCT_CATALOG_ADDR, + RECOMMENDATION_ADDR, + SHIPPING_ADDR, + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, + NEXT_PUBLIC_PLATFORM: ENV_PLATFORM, + NEXT_PUBLIC_OTEL_SERVICE_NAME: OTEL_SERVICE_NAME, + NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, + }, + images: { + loader: "custom", + loaderFile: "./utils/imageLoader.js" + } +}; + +module.exports = nextConfig; |
