Subsequent recipes will assume an environment that is capable of using ES modules. There are two strategies for accomplishing this: creating a build step that collects all the modules used into a single file for the browser to download, or using a browser that is capable of using ES modules. This recipe demonstrates the latter option.
Installing and configuring - Firefox
Getting ready
To step through this recipe, you need a computer with an operating system (OS) that is supported by Firefox. It supports recent versions of Windows and macOS, as well as a large number of Linux distributions. Most likely, if your OS doesn't support Firefox, you are already aware of this.
How to do it...
- To install Firefox, open a browser and enter the following URL:
https://www.mozilla.org/firefox. - Click the button that says Download to download the installer.
- After the installer has finished downloading, double click the installer and follow the onscreen instructions.
- To configure Firefox, open the Firefox browser and enter the following URL:
about:config. - The menu will allow you to enable advanced and experimental features. If you see a warning, click the button that says I accept the risk!
- Find the dom.moduleScripts.enabled setting, and double-click it to set the value to true, as shown in following screenshot:
How it works...
Firefox supports ES modules, but disables them by default. This allows developers to experiment with the feature, while the majority of users are not exposed to it.
There's more...
The same as the Installing and configuring - Chrome section.