<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Modules on Osmar Petry</title><link>https://osmarpetry.dev/tags/modules/</link><description>Recent content in Modules on Osmar Petry</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 23 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://osmarpetry.dev/tags/modules/rss.xml" rel="self" type="application/rss+xml"/><item><title>JavaScript Modules and Bundlers</title><link>https://osmarpetry.dev/blog/javascript-modules-and-bundlers/</link><pubDate>Mon, 23 Mar 2026 00:00:00 +0000</pubDate><guid>https://osmarpetry.dev/blog/javascript-modules-and-bundlers/</guid><description>&lt;p&gt;The goal here is to understand JavaScript module systems (IIFE, CommonJS, ESModules), how modern bundlers sit on top of them, and which build types to use for business apps and component libraries.&lt;/p&gt;&#10;&lt;p&gt;Module systems describe &lt;strong&gt;how code is organized and imported/exported&lt;/strong&gt; at the language level. Bundlers and build tools &lt;strong&gt;consume those modules&lt;/strong&gt; and produce optimized outputs for different environments (browser, Node, CDN, etc.).&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="part-1--module-systems"&gt;Part 1 — Module Systems&lt;/h2&gt;&#10;&lt;h3 id="iife-immediately-invoked-function-expression"&gt;IIFE (Immediately Invoked Function Expression)&lt;/h3&gt;&#10;&lt;p&gt;IIFEs are the classic pattern to create a private scope and avoid polluting &lt;code&gt;window&lt;/code&gt;, often combined with a single global namespace like &lt;code&gt;App&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>