Files
v10/packages/react/react-icons/rollup.config.js
T
Wesley LuytenandGitHub 017ecdbff9 feat: add compound html timerange component (#14)
* fix: add context logic to component factory

* feat: add compound time range html component
2025-09-18 17:58:53 -05:00

69 lines
1.7 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,
},
watch: {
clearScreen: false
},
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,
},
watch: {
clearScreen: false
},
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',
}),
],
},
];