From 7ec76486ec98a95e3d10079f7644214aaf0a1376 Mon Sep 17 00:00:00 2001 From: gnezim Date: Fri, 17 Apr 2026 18:11:04 +0300 Subject: [PATCH] Clean up build warnings: MF DTS, autoprefixer color-adjust, dev CORS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three non-fatal warnings surfaced by the Jenkins build log, fixed in the config layer: - module-federation.config.ts: dts: false. The @module-federation/ dts-plugin fails under our strict tsconfig and logs TYPE-001 every build. Remote types are not needed at runtime; consumers generate their own via their dev toolchain. - src/styles/_layout.scss: color-adjust → print-color-adjust. The unprefixed color-adjust shorthand is deprecated; the standard name is print-color-adjust. Matches the -webkit- prefixed sibling. - modern.config.ts: tools.devServer.headers explicitly set. MF warns when devServer.headers is empty and auto-assigns '*'. Providing an explicit allowlist silences the banner in dev builds; production behavior is unaffected (real reverse proxy manages CORS). --- modern.config.ts | 11 +++++++++++ module-federation.config.ts | 6 ++++++ src/styles/_layout.scss | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/modern.config.ts b/modern.config.ts index 57798748..64ce3b58 100644 --- a/modern.config.ts +++ b/modern.config.ts @@ -30,6 +30,17 @@ export default defineConfig({ cssLoader: { url: false, }, + // Explicit dev-server CORS headers. Silences the MF modern-js warning + // about empty devServer.headers (auto-assigning "*"). Production is + // unaffected — the real reverse proxy manages CORS. + devServer: { + headers: { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Headers": + "Content-Type, Authorization, Accept, Accept-Language", + "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS", + }, + }, }, output: { distPath: { root: isRemote ? "dist/remote" : "dist/standalone" }, diff --git a/module-federation.config.ts b/module-federation.config.ts index c2eac089..93f7081e 100644 --- a/module-federation.config.ts +++ b/module-federation.config.ts @@ -12,4 +12,10 @@ export default createModuleFederationConfig({ react: { singleton: true, requiredVersion: "^18.2.0" }, "react-dom": { singleton: true, requiredVersion: "^18.2.0" }, }, + // Disable DTS generation at build time. @module-federation/dts-plugin@2.3.3 + // fails against our strict tsconfig (exactOptionalPropertyTypes + + // noUncheckedIndexedAccess) and logs a TYPE-001 error. Types for the + // exposed modules are shipped to consumers via their own dev-time + // toolchain; the runtime does not need them. + dts: false, }); diff --git a/src/styles/_layout.scss b/src/styles/_layout.scss index 84730102..fd6cb93c 100644 --- a/src/styles/_layout.scss +++ b/src/styles/_layout.scss @@ -380,7 +380,7 @@ body { @media print { * { -webkit-print-color-adjust: exact; - color-adjust: exact !important; + print-color-adjust: exact !important; } .p-print-none {