liveBook · Manning

Bundling

As explained in React in Depth

The process of transforming source files and dependencies into optimized application bundles.

Bundling transforms source files and dependencies into application assets, allowing JavaScript to import CSS while producing separate CSS and JavaScript files for the document. section 7.3.2

Common build-and-bundle technologies include:

Importing CSS from JavaScript

A React JavaScript file can import a CSS file directly. Vite's bundler processes the combined code and emits separate CSS and JavaScript files, inserting them into the document. Without bundler support, reference the CSS file directly from HTML or configure a CSS loader. section 7.3.2

Figure 1.4 The React ecosystem is split into three main groups (UI, architecture, and productivity) and comprises hundreds of technologies, tools, and libraries. If you found the amount of technologies displayed in figure 1.1 daunting, this figure might break you.
figure

Maps bundling onto the wider React productivity ecosystem, including build tools alongside server rendering, testing, developer experience, monitoring, and documentation technologies. section 1.4.1

How React in Depth covers it

How deep it goes
Explains CSS imports and emitted assets, but defers loader configuration and other technical details to the setup.
Examples
Uses Vite CSS imports, separate emitted assets, direct HTML references, and alternative bundler CSS-loader configuration.
What it assumes
Assumes a React project setup and distinguishes bundler-based imports from conventional HTML file references.
What you can do after
Apply it via Vite to import CSS from JavaScript and produce document-ready CSS and JavaScript assets.
How it connects
Connects CSS loading with JavaScript modules, Vite, esbuild, CSS loaders, HTML, and React application setup.

Also explained in

Compare how 8 books explain bundling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of React in Depth. The section links point to the parts of the book it draws on.