And inside your main.js you can start importing and exporting your modules:
Using the export method in profile.js
As shown in the above example, it’s easy to use ECMAScript modules and there is no complex code in this case.
In another way, you can set .mjs extension to the file. So, the browser can identify the module but this doesn’t make big changes if you set the type attribute as a module to the script tag.
Addy Osmani and Mathias Bynens explain in this article that you might don’t need a web bundler such as webpack if you develop a web app with less than 100 modules. You can check out the article where they have exposed the best practices and good usage of ECMAScript modules here.
Find the code in the GitHub repository here.