mirror of
https://github.com/wharfkit/wallet-plugin-ledger.git
synced 2026-07-21 16:03:29 +00:00
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
import fs from 'fs'
|
|
import dts from 'rollup-plugin-dts'
|
|
import typescript from '@rollup/plugin-typescript'
|
|
|
|
import pkg from './package.json'
|
|
|
|
const name = pkg.name
|
|
const license = fs.readFileSync('LICENSE').toString('utf-8').trim()
|
|
const banner = `
|
|
/**
|
|
* ${name} v${pkg.version}
|
|
* ${pkg.homepage}
|
|
*
|
|
* @license
|
|
* ${license.replace(/\n/g, '\n * ')}
|
|
*/
|
|
`.trim()
|
|
|
|
const external = Object.keys(pkg.peerDependencies)
|
|
|
|
/** @type {import('rollup').RollupOptions} */
|
|
export default [
|
|
{
|
|
input: 'src/index.ts',
|
|
output: {
|
|
banner,
|
|
file: pkg.main,
|
|
format: 'cjs',
|
|
sourcemap: true,
|
|
exports: 'named',
|
|
},
|
|
plugins: [typescript({target: 'es6'})],
|
|
external,
|
|
},
|
|
{
|
|
input: 'src/index.ts',
|
|
output: {
|
|
banner,
|
|
file: pkg.module,
|
|
format: 'esm',
|
|
sourcemap: true,
|
|
},
|
|
plugins: [typescript({target: 'es2020'})],
|
|
external,
|
|
},
|
|
{
|
|
input: 'src/index.ts',
|
|
output: {banner, file: pkg.types, format: 'esm'},
|
|
plugins: [dts()],
|
|
},
|
|
]
|