From d0a39f71f6063b33ede7fc34431bcd891bd73f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Curda?= Date: Tue, 19 Nov 2024 12:57:21 +0100 Subject: [PATCH] Docs(icons): Transpile icons #DS-987 --- packages/icons/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/icons/README.md b/packages/icons/README.md index 49d1a42082..ff93a99e8b 100644 --- a/packages/icons/README.md +++ b/packages/icons/README.md @@ -83,4 +83,23 @@ export const Icon = ({ name, , size }) => { }; ``` +### Next.js with Pages Router + +If you are using Next.js with the Pages Router, it is necessary to add the following configuration to your Next.js configuration file +to transpile the `@lmc-eu/spirit-web-react` package, ensuring the correct functionality of the icons: + +```javascript +const nextConfig = { + transpilePackages: ['@lmc-eu/spirit-web-react'], + // other configurations... +}; + +export default nextConfig; +``` + +This configuration is not required if you are using the Next.js App Router. + +For more information, please see the [Next.js documentation][nextjs-transpilePackages]. + [`spirit-web`]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web +[nextjs-transpilePackages]: https://nextjs.org/docs/pages/api-reference/next-config-js/transpilePackages