mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-25 12:48:53 +01:00
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:
parent
f8738b207c
commit
b6c7b0bc71
1 changed files with 12 additions and 1 deletions
|
|
@ -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);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue