{"id":25959,"library":"mozu-require-compiler","title":"Mozu Require Compiler","description":"A customized version of the RequireJS optimizer (r.js) tailored for Mozu applications. This package provides a command-line tool for building AMD modules using the RequireJS module system. Version 3.0.2 is the latest release, but it is based on an older r.js codebase. It supports Node.js, Rhino/Java, and xpcshell environments. The primary use case is optimizing and combining AMD modules for browser delivery. Compared to the official requirejs package, this fork may include Mozu-specific patches or configuration defaults. However, it is largely unmaintained and users are advised to use the official `requirejs` package instead.","status":"deprecated","version":"3.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/Mozu/mozu-require-compiler","tags":["javascript"],"install":[{"cmd":"npm install mozu-require-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add mozu-require-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add mozu-require-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is a fork; use the official requirejs package for active development.","package":"requirejs","optional":false}],"imports":[{"note":"Use official requirejs package; mozu-require-compiler is a fork.","wrong":"const r = require('mozu-require-compiler');","symbol":"requirejs","correct":"import requirejs from 'requirejs';"},{"note":"CLI tool is called `r.js` not `mozu-require-compiler`. Install official requirejs globally.","wrong":"mozu-require-compiler -o buildconfig.js","symbol":"r.js CLI","correct":"r.js -o buildconfig.js"},{"note":"AMD-style define/require, not CommonJS. This is standard AMD.","wrong":"const dep = require('dep')","symbol":"define/require","correct":"define(['dep'], function(dep) { ... })"}],"quickstart":{"code":"// Install official requirejs\nnpm install -g requirejs\n\n// Build project using a build config\nr.js -o buildconfig.js\n\n// Example buildconfig.js\n({\n  appDir: './src',\n  baseUrl: '.',\n  dir: './dist',\n  modules: [\n    { name: 'main' }\n  ],\n  paths: {\n    jquery: 'empty:'\n  }\n})","lang":"javascript","description":"Install the official requirejs package, create a build configuration for your AMD project, and run the optimizer."},"warnings":[{"fix":"npm uninstall -g mozu-require-compiler && npm install -g requirejs","message":"mozu-require-compiler is a deprecated fork of r.js. Use the official requirejs package instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use requirejs package or update to a maintained AMD bundler.","message":"The package may lack updates for modern Node.js versions and may break > Node 10.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Run `r.js -v` instead of `mozu-require-compiler`.","message":"The CLI command is `r.js` not `mozu-require-compiler` after installation.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Review the default build config; override in your project's config file.","message":"The package may include Mozu-specific default configurations that differ from standard requirejs behavior.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Migrate to requirejs or a modern bundler like webpack or Rollup.","message":"The last release (3.0.2) was published years ago; there is no active maintenance.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install -g mozu-require-compiler (deprecated) or use requirejs instead.","cause":"Package not installed globally or locally.","error":"Error: Cannot find module 'mozu-require-compiler'"},{"fix":"Use define/require in AMD style, or convert to CommonJS if using Node.","cause":"Using CommonJS require on AMD-only code.","error":"TypeError: require(...) is not a function"},{"fix":"Ensure mozu-require-compiler is installed globally with -g flag.","cause":"Official r.js not installed; mozu-require-compiler installs as 'r.js' but may not be in PATH.","error":"r.js: command not found"},{"fix":"Provide absolute path or ensure file exists relative to working directory.","cause":"Incorrect path or missing file.","error":"Error: Build config not found: /path/to/buildconfig.js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}