From b6c7b0bc71aae6f6c5c8af07d4fd9a5148fa050f Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sun, 13 Jul 2025 08:44:35 -0400 Subject: [PATCH] feat: enhance Rollup configuration for client package - Updated terser plugin settings to preserve directives like 'use client'. - Added custom warning handler to ignore "use client" directive warnings during the build process. --- packages/client/rollup.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/client/rollup.config.js b/packages/client/rollup.config.js index 1a756b9de2..fd2578e0cd 100644 --- a/packages/client/rollup.config.js +++ b/packages/client/rollup.config.js @@ -31,7 +31,11 @@ const plugins = [ useTsconfigDeclarationDir: true, clean: true, }), - terser(), + terser({ + compress: { + directives: false, // Preserve directives like 'use client' + }, + }), ]; export default { @@ -53,4 +57,11 @@ export default { external: [...Object.keys(pkg.peerDependencies || {}), 'react/jsx-runtime'], preserveSymlinks: true, plugins, + onwarn(warning, warn) { + // Ignore "use client" directive warnings + if (warning.code === 'MODULE_LEVEL_DIRECTIVE') { + return; + } + warn(warning); + }, };