Files
v10/packages/react/react-icons/rollup.config.js
T
Christian PillsburyandClaude b5dd496a9d refactor: migrate key packages from tsup to rollup for build consistency
Migrate icon packages and main platform packages to rollup while maintaining
tsup for simpler core packages:

Packages migrated to rollup:
- packages/core/icons - Core SVG icon definitions
- packages/html/html-icons - HTML-specific icon components
- packages/html/html - Main HTML package
- packages/react/react-icons - React icon components

Packages remaining on tsup:
- Core packages (media, media-store, playback-engine) - Simple TypeScript builds
- Helper packages (*-media-elements, *-media-store) - Working fine with tsup
- React Native packages - Per exclusion request

Benefits:
- Consistent build tooling across icon and platform packages
- Better asset handling capability for future SVG/CSS requirements
- Maintained simplicity for packages that don't need advanced features
- All packages build successfully with proper CommonJS/ESM outputs

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-13 12:42:55 -07:00

62 lines
1.6 KiB
JavaScript

const typescript = require('@rollup/plugin-typescript');
const resolve = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
module.exports = [
// ESM build
{
input: 'src/index.ts',
output: {
file: 'dist/index.mjs',
format: 'esm',
sourcemap: true,
},
external: (id) => {
// Don't externalize relative imports (starts with . or /)
if (id.startsWith('.') || id.startsWith('/')) return false;
// Don't externalize absolute paths (local files)
if (id.includes('/') && !id.startsWith('@')) return false;
// Externalize all npm packages (including scoped ones)
return true;
},
plugins: [
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx']
}),
commonjs(),
typescript({
tsconfig: 'tsconfig.json',
declaration: false,
outDir: 'dist',
}),
],
},
// CommonJS build
{
input: 'src/index.ts',
output: {
file: 'dist/index.js',
format: 'cjs',
sourcemap: true,
},
external: (id) => {
// Don't externalize relative imports (starts with . or /)
if (id.startsWith('.') || id.startsWith('/')) return false;
// Don't externalize absolute paths (local files)
if (id.includes('/') && !id.startsWith('@')) return false;
// Externalize all npm packages (including scoped ones)
return true;
},
plugins: [
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx']
}),
commonjs(),
typescript({
tsconfig: 'tsconfig.json',
declaration: false,
outDir: 'dist',
}),
],
},
];