Bitcoinjs browser compile creates an empty file

0 votes

I'm trying build Bitcoinjs for browser testing folloiwng the instructions on the BitcoinJS page (included below).

$ npm install -g bitcoinjs-lib

$ npm -g install bitcoinjs-lib browserify uglify-js
$ browserify -r bitcoinjs-lib -s Bitcoin | uglifyjs > bitcoinjs.min.js

When I run this is does generate a file called bitcoinjs.min.js but it is empty. Can someone help me?

Aug 30, 2018 in Blockchain by slayer
• 29,170 points
53 views

1 answer to this question.

0 votes

Try the following: Create index.js with the following content in the same folder:

var bitcoin = {
  base58: require('bs58'),
  bitcoin: require('bitcoinjs-lib'),
  ecurve: require('ecurve'),
  BigInteger: require('bigi'),
  Buffer: require('buffer'),
  elliptic: require('elliptic'),
  bs58check: require('bs58check'),
}
module.exports = bitcoin;

Then run:

browserify index.js -s bitcoin | uglifyjs > bitcoinjs.min.js
answered Aug 30, 2018 by digger
• 26,550 points

Related Questions In Blockchain

0 votes
1 answer
+1 vote
1 answer

How can I achieve a functionality where an action is performed after a payment is received?

See this can be achieved in more ...READ MORE

answered Apr 20, 2018 in Blockchain by Perry
• 17,020 points
23 views
+1 vote
1 answer

What is the best way to search for an item in blockchain?

All transactions and records in blockchain are ...READ MORE

answered Apr 20, 2018 in Blockchain by Perry
• 17,020 points
51 views
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
82 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
158 views
0 votes
1 answer
0 votes
1 answer

Problem while compiling BitcoinJS for browser

The problem iss that you are using browserify wrong ...READ MORE

answered Aug 30, 2018 in Blockchain by digger
• 26,550 points
103 views
0 votes
2 answers