mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-21 18:04:08 +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,
|
useTsconfigDeclarationDir: true,
|
||||||
clean: true,
|
clean: true,
|
||||||
}),
|
}),
|
||||||
terser(),
|
terser({
|
||||||
|
compress: {
|
||||||
|
directives: false, // Preserve directives like 'use client'
|
||||||
|
},
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -53,4 +57,11 @@ export default {
|
||||||
external: [...Object.keys(pkg.peerDependencies || {}), 'react/jsx-runtime'],
|
external: [...Object.keys(pkg.peerDependencies || {}), 'react/jsx-runtime'],
|
||||||
preserveSymlinks: true,
|
preserveSymlinks: true,
|
||||||
plugins,
|
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