As of 2023 we can. we can call a function from a module and use it on the browser environment with webpack. Here's an example. Even a function contains the syntax "require" won't cause syntax error on the browser environment.
webpack sample code
What's webpack?