RequireJS is a JavaScript library and file loader which manages the dependencies between JavaScript files and in modular programming.

0 detections
0 websites tracked
Updated 25 May 2026

Websites Using RequireJS

No websites detected yet. Analyze a website to contribute data.

What Is RequireJS?

RequireJS is a classic JavaScript file and module loader that implements the Asynchronous Module Definition (AMD) specification, allowing applications to declare module dependencies and load them on demand in the browser. The direct answer to what RequireJS is: it is a pre-bundler-era module system that let developers split JavaScript into modules with explicit dependencies and load them asynchronously, long before native ES modules or bundlers like webpack existed. It is now legacy technology, but it is still detected on many older and enterprise applications.

RequireJS was created by James Burke and became the most popular implementation of the AMD pattern during the early-to-mid 2010s. Before bundlers and native modules, large JavaScript codebases faced two hard problems: managing dependency order (script A must load before script B) and avoiding a single giant file. RequireJS solved both by introducing define() to declare modules with their dependencies and require() to load them, fetching files asynchronously and executing them in the correct order. Precise current market-share figures are difficult to state with confidence because adoption has declined for years and detection methods vary, so any single percentage should be read cautiously. What detection sources such as Wappalyzer and BuiltWith consistently report is that RequireJS appears predominantly on legacy applications, content management deployments, and enterprise systems built in the AMD era.

RequireJS is closely associated with the broader AMD ecosystem and with optimization tooling such as r.js, which could combine AMD modules into a single optimized file for production, an early precursor to modern bundling.

How RequireJS Works

RequireJS is built around two core functions and a configuration step, all designed to load JavaScript modules asynchronously in the browser without a build step.

A module is declared with define(). A module lists its dependencies as an array of module names and provides a factory function that receives those dependencies as arguments and returns the module's value. For example, define(['jquery', 'utils'], function($, utils) { return { /* module API */ }; }) declares a module that depends on jQuery and a local utils module. RequireJS ensures both dependencies are loaded and executed before invoking the factory, then passes their return values in.

Application code requests modules with require(). Calling require(['app'], function(app) { app.start(); }) tells RequireJS to load the app module (and, transitively, everything it depends on) and then run the callback with the loaded value. Because loading is asynchronous, the browser is never blocked waiting on a long chain of synchronous script tags.

The entry point is wired up through the data-main attribute on the RequireJS script tag. A page typically includes a single tag such as <script data-main="js/main" src="js/require.js"></script>. RequireJS reads data-main, loads js/main.js as the application's starting module, and from there follows the dependency graph. This single-script bootstrap is one of the most recognizable RequireJS signatures.

Configuration is supplied through require.config() or requirejs.config(). The config defines a baseUrl (the root for module paths), paths (aliases that map short module names to file locations or CDN URLs), and shim settings (which adapt non-AMD libraries that use globals so they can participate in the dependency graph with proper ordering and exports). The shim mechanism was essential in practice because many popular libraries of the era were not written as AMD modules.

A typical RequireJS lifecycle: the page loads require.js, RequireJS reads data-main and fetches the main module, the main module's define/require calls trigger asynchronous loading of dependencies, RequireJS resolves the dependency graph and executes modules in dependency order, and finally the application starts. For production, the r.js optimizer could trace this graph ahead of time and concatenate and minify modules into fewer files, reducing the many small HTTP requests that pure runtime loading would otherwise generate.

How to Tell if a Website Uses RequireJS

RequireJS leaves several distinctive fingerprints, especially around its bootstrap script and its global functions.

Signals in the page and network

  • The RequireJS script and data-main. In View Source, look for a script tag loading require.js, require.min.js, or a file named require with a data-main attribute, for example <script data-main="js/main" src="js/require.js"></script>. The data-main attribute is a hallmark of RequireJS.
  • Global functions. In the DevTools Console, type requirejs, require, or define. RequireJS defines window.requirejs and window.require, and define.amd is set as the AMD marker. Checking typeof define === 'function' && define.amd is a classic AMD detection test.
  • Version marker. require.version (or requirejs.version) returns the loader's version string, confirming detection.
  • CDN paths. RequireJS is frequently served from paths such as cdnjs.cloudflare.com/ajax/libs/require.js/ or cdn.jsdelivr.net/npm/requirejs.
  • AMD module patterns in source. Searching JavaScript files for define([ and require([ calls reveals the AMD module style RequireJS loads.
  • Many small JS requests. In the Network tab, an un-optimized RequireJS app loads numerous individual module files asynchronously, a pattern distinct from a single bundled file.

Tools to confirm it

ToolWhat you doWhat it reveals
View SourceOpen the page source in your browserA require.js script tag with a data-main attribute
DevTools ConsoleType require.version and define.amdConfirms the loader and the AMD marker are present
DevTools ConsoleType typeof requirejsfunction confirms RequireJS is loaded globally
DevTools NetworkFilter requests by require or watch JS loadsThe loader file plus many asynchronously loaded module files
WappalyzerRun the browser extension on the pageFlags RequireJS in the JavaScript frameworks / module loaders category
BuiltWithEnter the domain on the BuiltWith siteReports current and historical RequireJS detection

For a broader walkthrough of identifying any front-end loader or library, see our guide on how to check what JavaScript libraries a website uses and the general primer on how to find out what technology a website uses.

Key Features

RequireJS is defined by asynchronous loading and explicit dependency management.

  • AMD module loading. Implements the Asynchronous Module Definition spec with define() and require() for declaring and consuming modules.
  • Asynchronous, on-demand loading. Fetches module files without blocking the page and resolves dependencies in the correct order.
  • data-main bootstrap. A single script tag entry point that loads the application's main module.
  • Path configuration. baseUrl and paths aliases map short module names to file locations or CDNs.
  • Shim configuration. Adapts non-AMD libraries that rely on globals so they integrate into the dependency graph with proper ordering and exports.
  • Plugin loaders. Loader plugins (such as text! for loading templates as strings) extend what RequireJS can fetch.
  • r.js optimizer. A build-time tool that traces dependencies and concatenates and minifies modules into fewer files for production.
  • No build step required to run. RequireJS can run directly in the browser during development without compilation.

Two features explain RequireJS's historical importance. The shim configuration made it practical to adopt AMD incrementally in real projects, because the JavaScript ecosystem of the time was full of libraries that exposed globals rather than AMD modules; shim let those libraries participate in the dependency graph anyway. And the r.js optimizer previewed the role bundlers play today, tracing the module graph ahead of time to combine many small files into an optimized payload, which addressed the request-count overhead of pure runtime loading.

Pros and Cons

RequireJS trade-offs reflect both the problems it solved and the era it belongs to.

Pros

  • Brought real modularity and explicit dependency management to browser JavaScript before native support existed.
  • Loads modules asynchronously without blocking page rendering.
  • Runs directly in the browser with no mandatory build step during development.
  • The r.js optimizer provided a production bundling path.
  • Stable and proven across many large legacy applications.

Cons

  • Largely superseded by native ES modules and modern bundlers (webpack, Rollup, Vite, esbuild).
  • Verbose, callback-heavy syntax compared with import/export.
  • Configuration (paths, shim) can become complex and brittle in large projects.
  • Un-optimized apps issue many small HTTP requests, hurting performance without r.js.
  • Shrinking ecosystem and developer familiarity; rarely chosen for new work.
  • Predates modern tooling features like tree-shaking and hot module replacement.

RequireJS vs Alternatives

RequireJS competes with other module approaches, most of which have now eclipsed it. The table frames the landscape.

OptionEraModule styleBuild stepNotes
RequireJS2010sAMD (define/require)Optional (r.js)Classic browser AMD loader
Native ES Modules2017-presentimport/exportNone (browser native)Built into modern browsers and Node
webpack2014-presentAll formats, bundledRequiredDominant bundler with tree-shaking, HMR
Vite / esbuild / RollupLate 2010s-presentES modules, bundledRequiredFast modern build tooling
CommonJSNode erarequire/module.exportsBundler for browserNode's classic module system

The most instructive comparison is RequireJS versus native ES modules and modern bundlers. RequireJS solved dependency management at runtime in the browser using a callback-based AMD syntax. Native ES modules later standardized modules directly into the language with clean import/export syntax that the browser understands without any loader, and modern bundlers like webpack and Vite added build-time optimization, tree-shaking, code splitting, and hot module replacement that RequireJS's r.js only partially anticipated. The combination of native modules for syntax and bundlers for optimization made RequireJS unnecessary for new projects. Its continued relevance is almost entirely about maintaining the substantial base of existing AMD applications.

Because RequireJS-era apps frequently shimmed older libraries to load them as modules, recognizing it often goes hand in hand with spotting other legacy front-end dependencies; combining this profile with our other library guides helps build a complete picture of an older stack.

Use Cases

RequireJS appears in a recognizable set of mostly legacy scenarios.

  • Legacy AMD applications. Large client-side applications built in the early-to-mid 2010s that organized code as AMD modules.
  • Enterprise systems. Long-lived internal and customer-facing applications that adopted RequireJS and remain in production.
  • CMS and plugin ecosystems. Older content management deployments and themes that loaded JavaScript through RequireJS.
  • Incremental modular code without bundlers. Projects that needed dependency management in the browser before bundlers were standard, especially where a build step was undesirable.
  • Maintenance and migration work. Teams keeping existing RequireJS apps running or migrating them toward native ES modules and modern bundlers.

For competitive research and lead generation, detecting RequireJS is a strong indicator of an older web stack predating the modern bundler era, which often signals technical debt or an opportunity for modernization services in a prospect's application.

Frequently Asked Questions

Is RequireJS still used today?

It is no longer a common choice for new projects, but it is still found on a meaningful number of older and enterprise applications. Native ES modules and modern bundlers like webpack and Vite have replaced it for greenfield work. RequireJS remains relevant mainly for maintaining the large installed base of existing AMD applications built during the 2010s.

What is the difference between RequireJS and AMD?

AMD (Asynchronous Module Definition) is the specification, the agreed-upon pattern for declaring modules and their dependencies with define() and loading them asynchronously. RequireJS is the most popular implementation of that specification. In other words, AMD is the standard and RequireJS is the loader that brings it to life in the browser. The define.amd marker on the page is how code advertises that an AMD loader like RequireJS is available.

How do I detect RequireJS on a website?

Check View Source for a script tag loading require.js with a data-main attribute, which is a hallmark of RequireJS. Then open the DevTools Console and type require.version, requirejs, or define.amd; if the loader is present you will get a version string and confirmation that the AMD marker exists. In the Network tab, an un-optimized RequireJS app also tends to load many small module files asynchronously.

What replaced RequireJS?

Two developments replaced it. First, native ES modules standardized import/export syntax directly into JavaScript, so browsers can load modules without any loader library. Second, modern bundlers such as webpack, Rollup, Vite, and esbuild added build-time optimization, tree-shaking, code splitting, and hot module replacement. Together they made RequireJS unnecessary for new applications, though it remains in use on legacy systems.

Should I migrate a RequireJS application to modern tooling?

For actively developed applications, migrating to native ES modules and a modern bundler usually pays off in cleaner syntax, better performance, smaller bundles through tree-shaking, and a larger pool of compatible tools and developers. The migration can be done incrementally. For stable applications that are no longer changing, the cost of migration may not be justified, and keeping the working RequireJS setup can be the pragmatic choice.

Want to identify the module loaders, frameworks, and full technology stack behind any website instantly? Try StackOptic at https://stackoptic.com.