App

Modular apps are TypeScript and React-based Single Page Applications (SPAs) built with Webpack v5 (by default) or esbuild (by turning on useModularEsbuild in the configuration).

Supported features

Apps support a subset of Create React App features that make sense in a monorepo context. See this page for a detailed list of supported features.

Build

To build your app for deployment, run:

modular build my-app-name

The resulting output is an optimized site that can be served statically. All code (files in src plus external dependencies required in the code) is bundled in a single blob of code that can be split in different files.

Start

To run your app locally on a development server, run start:

modular start my-app-name

This starts a developer server on port 3000, serving the app with an additional runtime layer that provides developer experience functionalities like hot reloading and on-screen error overlay.

Entry-point

Apps need an entry-point file located at src/index.tsx, which typically uses React to render components to the DOM, generated at public/index.html.

Template

Apps are generated by modular add using the modular-template-app template.