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.
This commit is contained in:
committed by
Marco Beretta
parent
f8738b207c
commit
b6c7b0bc71
@@ -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);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user