diff --git a/packages/dnb-eufemia/babel.config.js b/packages/dnb-eufemia/babel.config.js index be2a37a8e03..d517f570b62 100644 --- a/packages/dnb-eufemia/babel.config.js +++ b/packages/dnb-eufemia/babel.config.js @@ -78,7 +78,18 @@ const productionPlugins = [ ] if (global.bundler !== 'rollup') { - productionPlugins.push('babel-plugin-transform-next-use-client') + productionPlugins.push([ + 'babel-plugin-transform-next-use-client', + { + customClientImports: [ + 'Context', + 'useMedia', + 'useMediaQuery', + 'useTheme', + 'extendPropsWithContextInClassComponent', + ], + }, + ]) } if (typeof process.env.BABEL_ENV !== 'undefined') { diff --git a/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts b/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts index 70d1fe92dce..5b65144283b 100644 --- a/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts +++ b/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts @@ -290,7 +290,7 @@ describe('babel build', () => { const content = fs.readFileSync( path.resolve( packpath.self(), - `build${stage}/components/accordion/Accordion.js` + `build${stage}/components/button/Button.js` ), 'utf-8' )