I'm trying to include web3 & truffle in my chrome extension. In npm, I'm doing it this way:
const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); ...........
But in chrome it's giving this error:
Uncaught ReferenceError: require is not defined
I know that we can't do it this way in the browser mode. But how to solve this problem? What's the correct way to use truffle & web3js