Files
linea-monorepo/bridge-ui/next.config.mjs
Victorien Gauch 81583c8d14 feat(bridge-ui): add base path config (#1095)
* fix: add base path config to the bridge ui

* fix: remove unused import

* update bridge UI ci build job

* fix: update env.template
2025-06-09 16:13:35 +02:00

56 lines
1.2 KiB
JavaScript

const isProd = process.env.NEXT_PUBLIC_ENVIRONMENT === "production";
const basePath = isProd ? "/hub/bridge" : "";
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
reactStrictMode: true,
basePath,
env: {
NEXT_PUBLIC_BASE_PATH: basePath,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
},
sassOptions: {
prependData: `@use 'sass:math'; @import 'src/scss/breakpoints';`,
},
webpack: (config) => {
const warning = [...(config.ignoreWarnings || []), { module: /typeorm/ }];
config.ignoreWarnings = warning;
config.resolve.fallback = {
fs: false,
};
config.externals.push("pino-pretty", "lokijs", "encoding");
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.(".svg"));
config.module.rules.push(
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/,
},
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] },
use: ["@svgr/webpack"],
},
);
fileLoaderRule.exclude = /\.svg$/i;
return config;
},
};
export default nextConfig;