The goal of this text is to acquire knowledge on the subject, as a final goal to have more understanding in packaging business projects to better understand how to optimize them, and to create my own library of components

IIFE

First, I created the object where the modules will be placed into.

Then I write the module functions for the parent

I write the parent module, then the other modules. Here the order matters

Problem with this strategy is that if you have another third-party module that uses the name App, it will conflict with our App and it will be bad.

CommonJS

Different from IFFE

It is still the same as exporting a JSON with its functions inside

Pros:

Cons:

This way you export with the CommonJS

ESModule

ESModules (ECMAScript Modules) are a standardized module system for JavaScript, introduced in ECMAScript 6 (ES6). They provide a way to organize code into reusable components, making it easier to maintain and share code.