1 min readAug 11, 2017
Derrick Ho it sounds like you’re looking for a module bundler like webpack, rollup.js, or Browserify.
To avoid including browser-only stuff in the compiled code:
- If using webpack, set the target to
node
: https://webpack.js.org/concepts/targets/#usage - If using Browserify, pass the
--node
flag