import type { RollupOptions } from 'rollup' import dts from 'rollup-plugin-dts' import { terser } from 'rollup-plugin-terser' import typescript from 'rollup-plugin-typescript2' const pkg = require('./package.json') const name = 'bdcontract' export default [ { input: 'src/index.ts', output: [ { file: `${pkg.main}`, format: 'umd', name, sourcemap: true, }, { file: `${pkg.module}`, format: 'es', sourcemap: true }, { file: `${pkg.iife}`, format: 'iife', name, sourcemap: true, }, ], plugins: [ typescript({ tsconfig: 'tsconfig.build.json', useTsconfigDeclarationDir: true, }), terser(), ], }, { input: 'types/index.d.ts', output: [{ file: 'lib/index.d.ts' }], plugins: [dts()], }, ] as RollupOptions