From bf715be9816a860c7669fe9b8a0e0a499eb0bfc5 Mon Sep 17 00:00:00 2001 From: Brijesh Bittu Date: Wed, 11 Sep 2024 14:06:42 +0530 Subject: [PATCH] Review fixes --- packages/pigment-css-nextjs-plugin/src/index.ts | 7 ++++++- .../pigment-css-react/src/utils/cssFnValueToVariable.ts | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/pigment-css-nextjs-plugin/src/index.ts b/packages/pigment-css-nextjs-plugin/src/index.ts index 11b4a6e7..04d9576f 100644 --- a/packages/pigment-css-nextjs-plugin/src/index.ts +++ b/packages/pigment-css-nextjs-plugin/src/index.ts @@ -73,7 +73,12 @@ export function withPigment(nextConfig: NextConfig, pigmentConfig?: PigmentOptio // Need to point to the react from node_modules during eval time. // Otherwise, next makes it point to its own version of react that // has a lot of RSC specific logic which is not actually needed. - if (what.startsWith('@babel') || what.startsWith('react') || what.startsWith('next')) { + if ( + what === 'react' || + what.startsWith('react-dom/') || + what.startsWith('@babel/') || + what.startsWith('next/') + ) { return require.resolve(what); } if (asyncResolve) { diff --git a/packages/pigment-css-react/src/utils/cssFnValueToVariable.ts b/packages/pigment-css-react/src/utils/cssFnValueToVariable.ts index 1bcfb3b0..0ac97ff3 100644 --- a/packages/pigment-css-react/src/utils/cssFnValueToVariable.ts +++ b/packages/pigment-css-react/src/utils/cssFnValueToVariable.ts @@ -155,10 +155,6 @@ function iterateAndReplaceFunctions( const css = styleObj as StyleObj; Object.keys(css).forEach((key) => { const value = css[key]; - if (!value) { - // ignore null value - return; - } if (typeof value === 'object') { if (!Array.isArray(value)) {