@settlemint/sdk-next
Version:
Next.js integration module for SettleMint SDK, providing React components and middleware for web applications
1 lines • 1.51 kB
Source Map (JSON)
{"version":3,"file":"with-settlemint.cjs","names":["nextConfig: C"],"sources":["../../src/config/with-settlemint.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\n/**\n * Options for configuring the SettleMint configuration.\n */\nexport interface WithSettleMintOptions {\n /**\n * Whether to disable the SettleMint configuration.\n */\n disabled?: boolean;\n}\n\n/**\n * Modifies the passed in Next.js configuration with SettleMint-specific settings.\n *\n * @param nextConfig - The original Next.js configuration\n * @param options - Options for customizing the SettleMint configuration\n * @returns The modified Next.js configuration\n * @throws If the SettleMint configuration cannot be read or processed\n */\nexport async function withSettleMint<C extends NextConfig>(\n nextConfig: C,\n { disabled = false }: WithSettleMintOptions = {},\n): Promise<C> {\n if (disabled) return nextConfig;\n\n const baseConfig = {\n ...nextConfig,\n };\n\n return {\n ...baseConfig,\n headers: async () => [\n {\n source: \"/(.*)\",\n headers: [{ key: \"X-Frame-Options\", value: \"DENY\" }],\n },\n ],\n poweredByHeader: false,\n reactStrictMode: true,\n } as C;\n}\n"],"mappings":";;;;;;;;;;;AAoBA,eAAsB,eACpBA,YACA,EAAE,WAAW,OAA8B,GAAG,CAAE,GACpC;AACZ,KAAI,SAAU,QAAO;CAErB,MAAM,aAAa,EACjB,GAAG,WACJ;AAED,QAAO;EACL,GAAG;EACH,SAAS,YAAY,CACnB;GACE,QAAQ;GACR,SAAS,CAAC;IAAE,KAAK;IAAmB,OAAO;GAAQ,CAAC;EACrD,CACF;EACD,iBAAiB;EACjB,iBAAiB;CAClB;AACF"}