55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import type { RollupOptions } from '@rollup'
|
|
import dts from 'rollup-plugin-dts'
|
|
import { terser } from 'rollup-plugin-terser'
|
|
import typescript from 'rollup-plugin-typescript2'
|
|
import commonjs from '@rollup/plugin-commonjs'
|
|
|
|
const pkg = require('./package.json')
|
|
|
|
const name = 'bdcontract'
|
|
|
|
export default [
|
|
{
|
|
input: 'src/index.ts',
|
|
output: [
|
|
{
|
|
file: `${pkg.main}`,
|
|
format: 'umd',
|
|
name,
|
|
sourcemap: true,
|
|
globals:{
|
|
"@daotl/cryptico":"cryptico",
|
|
"@lifeomic/axios-fetch":"axiosFetch",
|
|
"axios":"axios",
|
|
"sm-crypto":"smCrypto"
|
|
}
|
|
},
|
|
{ file: `${pkg.module}`, format: 'es', sourcemap: true },
|
|
{
|
|
file: `${pkg.iife}`,
|
|
format: 'iife',
|
|
name,
|
|
sourcemap: true,
|
|
globals:{
|
|
"@daotl/cryptico":"cryptico",
|
|
"@lifeomic/axios-fetch":"axiosFetch",
|
|
"axios":"axios",
|
|
"sm-crypto":"smCrypto"
|
|
}
|
|
},
|
|
],
|
|
plugins: [
|
|
typescript({
|
|
tsconfig: 'tsconfig.build.json',
|
|
useTsconfigDeclarationDir: true,
|
|
}),
|
|
terser(),commonjs()
|
|
],
|
|
},
|
|
{
|
|
input: 'types/index.d.ts',
|
|
output: [{ file: 'lib/index.d.ts' }],
|
|
plugins: [dts()],
|
|
},
|
|
] as RollupOptions
|