Bitcoinjs browser compile creates an empty file

0 votes

I'm trying to build Bitcoinjs for browser testing following the below instructions.

$ 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,370 points
531 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,740 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 21, 2018 in Blockchain by Perry
• 17,100 points
699 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 21, 2018 in Blockchain by Perry
• 17,100 points
1,935 views
+1 vote
1 answer

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

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,460 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
1,945 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,469 views
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,740 points
1,354 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP