I\'m new to browserify and trying to load npm modules in browser but I\'m getting the following error:
Uncaught ReferenceError: require is not defined
Short answer: remove the script.js import
Longer answer:
You are getting the error because the method requireis not defined in the browser. You shouldn't include script.js.
The idea behind Browserify is that you can split up your sources using CommonJS modules and bundle them into one file to be used in the browser. Browserify will traverse all your sources and will concatenate all required files into the bundle.