bdcontract-sdk-javascript/rollup.config.ts

65 lines
1.5 KiB
TypeScript
Raw Permalink Normal View History

2023-03-18 10:43:58 +00:00
import type { RollupOptions } from '@rollup'
2023-03-18 11:55:44 +00:00
import commonjs from '@rollup/plugin-commonjs'
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'
const pkg = require('./package.json')
const name = 'bdcontract'
export default [
2023-03-18 11:55:44 +00:00
{
input: 'node_modules/@lifeomic/axios-fetch/src/index.js',
output: {
file: 'dist/axios-fetch.iife.js',
format: 'iife',
name: 'axiosFetch',
},
plugins: [commonjs()],
},
2023-03-14 17:15:57 +00:00
{
input: 'src/index.ts',
output: [
{
file: `${pkg.main}`,
format: 'umd',
name,
sourcemap: true,
2023-03-18 11:55:44 +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 11:55:44 +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 11:55:44 +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