@swipewallet/venus-js
Version:
A JavaScript SDK for Ethereum and the Venus Protocol.
42 lines (39 loc) • 925 B
text/typescript
// Rollup builds only the browser version using the Node.js build.
import { nodeResolve as resolve } from '@rollup/plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import minify from 'rollup-plugin-babel-minify';
import json from '@rollup/plugin-json';
const BrowserBuildPath = './dist/browser/venus.min.js';
export default [{
input: './dist/nodejs/index.js',
onwarn: (message) => {
if (message.code === 'MISSING_NODE_BUILTINS') return;
},
output: {
name: 'Venus',
file: BrowserBuildPath,
format: 'iife',
sourcemap: false,
globals: {
'http': '{}',
'https': '{}',
},
},
plugins: [
resolve({
preferBuiltins: true,
jsnext: true,
main: true,
browser: true,
}),
commonjs({
namedExports: { Venus: ['Venus'] },
}),
minify({ comments: false }),
json(),
],
external: [
'http',
'https',
]
}];