mirror of
https://github.com/wharfkit/abicache.git
synced 2026-07-21 17:43:33 +00:00
37 lines
986 B
JavaScript
37 lines
986 B
JavaScript
import dts from 'rollup-plugin-dts'
|
|
import typescript from '@rollup/plugin-typescript'
|
|
import cleanup from 'rollup-plugin-cleanup'
|
|
import pkg from './package.json'
|
|
|
|
const external = Object.keys(pkg.dependencies)
|
|
|
|
/** @type {import('rollup').RollupOptions} */
|
|
export default [
|
|
{
|
|
input: 'src/index.ts',
|
|
output: {
|
|
file: pkg.main,
|
|
format: 'cjs',
|
|
sourcemap: true,
|
|
exports: 'named',
|
|
},
|
|
plugins: [typescript({target: 'es6'}), cleanup({extensions: ['js', 'ts']})],
|
|
external,
|
|
},
|
|
{
|
|
input: 'src/index.ts',
|
|
output: {
|
|
file: pkg.module,
|
|
format: 'esm',
|
|
sourcemap: true,
|
|
},
|
|
plugins: [typescript({target: 'es2020'}), cleanup({extensions: ['js', 'ts']})],
|
|
external,
|
|
},
|
|
{
|
|
input: 'src/index.ts',
|
|
output: {file: pkg.types, format: 'esm'},
|
|
plugins: [dts(), cleanup({extensions: ['d.ts']})],
|
|
},
|
|
]
|