During the compilation of my JS code I used the statement
Web3 = require('web3') for importing the web3 library. But since the
require function doesn't work in a web application, I would like to know how it can be done.
by web application you mean HTML/..
download web3js form github repo.
you could load it as normal js file using
Your question implies that you are using a package manager - npm perhaps?
Your question is however lacking in details so I am just making assumptions..