bdcontract-sdk-javascript/rollup.config.ts

55 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-03-18 10:43:58 +00:00
import type { RollupOptions } from '@rollup'
2023-03-14 17:15:57 +00:00
import dts from 'rollup-plugin-dts'
import { terser } from 'rollup-plugin-terser'
import typescript from 'rollup-plugin-typescript2'
2023-03-18 10:43:58 +00:00
import commonjs from '@rollup/plugin-commonjs'
2023-03-14 17:15:57 +00:00
const pkg = require('./package.json')
const name = 'bdcontract'
export default [
{
input: 'src/index.ts',
output: [
{
file: `${pkg.main}`,
format: 'umd',
name,
sourcemap: true,
2023-03-18 10:43:58 +00:00
globals:{
"@daotl/cryptico":"cryptico",
"@lifeomic/axios-fetch":"axiosFetch",
"axios":"axios",
"sm-crypto":"smCrypto"
}
2023-03-14 17:15:57 +00:00
},
{ file: `${pkg.module}`, format: 'es', sourcemap: true },
{
file: `${pkg.iife}`,
format: 'iife',
name,
sourcemap: true,
2023-03-18 10:43:58 +00:00
globals:{
"@daotl/cryptico":"cryptico",
"@lifeomic/axios-fetch":"axiosFetch",
"axios":"axios",
"sm-crypto":"smCrypto"
}
2023-03-14 17:15:57 +00:00
},
],
plugins: [
typescript({
tsconfig: 'tsconfig.build.json',
useTsconfigDeclarationDir: true,
}),
2023-03-18 10:43:58 +00:00
terser(),commonjs()
2023-03-14 17:15:57 +00:00
],
},
{
input: 'types/index.d.ts',
output: [{ file: 'lib/index.d.ts' }],
plugins: [dts()],
},
] as RollupOptions