In the browser, you can not use require API, so you need to somehow bundle your code, you have few options:

  • Browserify
  • Webpack
  • Rollup

These module bundlers allow you to specify an 'entry' point and then bundle all the required modules together in a single file.

Similar questions that answer this problem: Gulp + babelify + browserify issue

Related Query

More Query from same tag