LibreChat/packages/client/rollup.config.js
Danny Avila 6e928cc468
🔧 chore: Revert Shared Links / Data-Table Changes from #9698 (#10897)
* chore: Remove @rollup/plugin-terser from package.json and rollup.config.js

* 🔧 chore: Revert Shared Links / Data-Table Changes from #9698

- Added sorting functionality for title and creation date in the Shared Links table.
- Implemented debounced search filtering for improved performance.
- Updated DataTable integration to support new features and improved user experience.
- Refactored delete handling to support bulk deletion of shared links.
- Adjusted dialog components for better accessibility and user feedback.

* 🗑️ chore: Remove unused translation keys from English locale

- Deleted keys related to managing archived chats, deleting archived chats, and opening conversations to streamline the translation file.
2025-12-11 16:39:32 -05:00

82 lines
2.1 KiB
JavaScript

// ESM bundler config for React components
import { fileURLToPath } from 'url';
import alias from '@rollup/plugin-alias';
import postcss from 'rollup-plugin-postcss';
import replace from '@rollup/plugin-replace';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import { dirname, resolve as pathResolve } from 'path';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import pkg from './package.json';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const plugins = [
peerDepsExternal(),
alias({
entries: [{ find: '~', replacement: pathResolve(__dirname, 'src') }],
}),
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
browser: true,
preferBuiltins: false,
}),
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),
'process.env.VITE_ENABLE_LOGGER': JSON.stringify(process.env.VITE_ENABLE_LOGGER || 'false'),
'process.env.VITE_LOGGER_FILTER': JSON.stringify(process.env.VITE_LOGGER_FILTER || ''),
preventAssignment: true,
}),
commonjs(),
postcss({
extract: false,
inject: true,
minimize: process.env.NODE_ENV === 'production',
modules: false,
config: {
path: './postcss.config.js',
},
}),
typescript({
tsconfig: './tsconfig.json',
useTsconfigDeclarationDir: true,
clean: true,
check: false,
}),
];
const isDev = process.env.NODE_ENV !== 'production';
export default {
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: isDev ? 'inline' : true,
exports: 'named',
},
{
file: pkg.module,
format: 'esm',
sourcemap: isDev ? 'inline' : true,
exports: 'named',
},
],
external: [
...Object.keys(pkg.peerDependencies || {}),
'react/jsx-runtime',
'react/jsx-dev-runtime',
],
preserveSymlinks: true,
plugins,
onwarn(warning, warn) {
// Ignore "use client" directive warnings
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') {
return;
}
warn(warning);
},
};