This is because
You have three options:
- Use the
- Use a CommonJS implementation. It has synchronous dependencies like Node.js
- Use an asynchronous module definition (AMD) implementation.
CommonJS client side-implementations include (most of them require a build step before you deploy):
- Browserify – You can use most Node.js modules in the browser. This is my personal favorite.
- Rollup – a new contender. It leverages ES6 modules and includes tree-shaking abilities (removes unused code).
You can read more about my comparison of Browserify vs (deprecated) Component.
AMD implementations include:
Note, in your search for choosing which one to go with, you’ll read about Bower. Bower is only for package dependencies and is unopinionated on module definitions like CommonJS and AMD.