Files
v10/packages/core/media-store/rollup.config.js
T
77c2932b8d fix(media-store): replace tsup with rollup for consistent build tooling
- Remove tsup configuration and dependencies
- Add rollup configuration matching other packages in monorepo
- Use 'rollup -c && tsc --project tsconfig.build.json' build pattern
- Add tsconfig.build.json for declaration-only builds
- Install required rollup plugins (@rollup/plugin-typescript, node-resolve, commonjs)

This eliminates the need for manual dist file modifications by using the same
proven build approach as HTML/React packages. TypeScript now automatically
generates all .d.ts files in proper directory structure.

Fixes the fundamental build system inconsistency where media-store used different
tooling than the rest of the monorepo.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 07:59:56 -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',
}),
],
},
];