Files
xo-stack/rollup.config.js
T
James Zuccon f2210e631a Initial commit
Signed-off-by: James Zuccon <zuccon@gmail.com>
2024-08-16 22:06:01 +10:00

31 lines
821 B
JavaScript

// Import package.json to reduce name repetition.
// eslint-disable-next-line import/extensions
import pkg from './package.json';
import dts from 'rollup-plugin-dts';
export default [
// Build main module in both ES and CJS
{
// Specify entry point for building
input: 'dist/module/lib/index.js',
// Omit all dependencies and peer dependencies from the final bundle
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
// Produce outputs for ES and CJS
output: [
{ file: pkg.module, format: 'es' },
{ file: pkg.main, format: 'cjs' },
],
},
// Build type definitions for the library
{
input: 'dist/module/lib/index.d.ts',
output: [{ file: pkg.typings, format: 'es' }],
plugins: [dts()],
},
];