Modules and Tooling
Split code into ES modules, load code on demand with import(), manage packages with npm, and meet bundlers, linters, formatters and TypeScript.
Real programs are not one long file. This phase teaches ES modules: how a file exports what it wants to share and another file imports it, why modules have their own scope and always run in strict mode, and how the browser loads a whole graph of files from one <script type="module">. Then **dynamic import(), which loads code only when it is needed, the idea behind code splitting**.
The second half is the toolbox every JavaScript job uses: npm and package.json (dependencies, scripts, version ranges and lockfiles), bundlers and dev servers such as Vite (why we bundle, what transpiling means), ESLint and Prettier (catching bugs and ending style arguments), and a first look at TypeScript, which adds types you check before running and then removes them.
The live preview is one page, so it can't hold several files. Live examples use <script type="module">, import maps and data: URLs to create small modules inside the page, or simulate a tool in a few lines. Multi-file projects, npm, Vite, ESLint and TypeScript are shown as normal code blocks with realistic terminal output, exactly what you'll see on your own computer.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.