Registry / web-framework / babel-preset-remax

babel-preset-remax

JSON →
library2.15.14jsnpmunverified

Babel preset for Remax, a framework for building mini-programs using React. Current stable version is 2.15.14, with regular releases on GitHub. This preset configures @babel/preset-react, @babel/preset-typescript, and plugins for decorators and class properties, tailored for Remax apps. It differs from generic React presets by providing options to control React runtime, TypeScript namespace support, and legacy decorator syntax, ensuring compatibility with mini-program environments.

npm install babel-preset-remax
INSTALL
IMPORT
SIG · BABEL-PRESET-REMAX
B
babel-preset-remax
web-frameworkjavascriptv2.15.14
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
module.exports = require('babel-preset-remax')
The preset is exported as a CommonJS module; used in .babelrc or babel.config.js via presets array.
remax
presets: ['remax']
presets: ['babel-preset-remax']
Babel resolves 'remax' to the preset package; full name is optional but works.
Options
interface RemaxPresetOptions { react?: object; typescript?: object; decorators?: object; 'class-properties'?: object; 'throw-if-namespace'?: boolean; }
TypeScript types are shipped; import for type checking: import type { RemaxPresetOptions } from 'babel-preset-remax';

Configuration for Remax Babel preset with React automatic runtime, TypeScript namespace support, loose class properties, and disabled throw-if-namespace.

// babel.config.js module.exports = { presets: [ ['remax', { react: { runtime: 'automatic' }, typescript: { allowNamespaces: true }, 'class-properties': { loose: true }, 'throw-if-namespace': false }] ] };
Debug
Known issues
deprecatedThe 'throw-if-namespace' option is deprecated in recent React presets; use 'runtime: 'automatic'' instead.
fix
Remove 'throw-if-namespace' and set 'react.runtime' to 'automatic'.
affects: >=2.15.0
gotchaClass properties loose mode may affect compatibility with older mini-program runtimes; test thoroughly.
fix
Set 'class-properties.loose' to false if strict spec compliance is needed.
affects: all
gotchaEnabling 'decorators.legacy' requires 'class-properties.loose' to be true for correct ordering.
fix
Set both 'decorators.legacy: true' and 'class-properties.loose: true'.
affects: all
breakingBabel 7.0+ is required; older versions will fail with 'Cannot find module'.
fix
Upgrade @babel/core to >=7.0.0.
affects: <7.0.0
Errors
Common errors & fixes
Error: [BABEL] unknown option: .throw-if-namespace
Invalid option name; correct key is 'throw-if-namespace' (with quotes) in Babel config.
fix
Use 'throw-if-namespace' as a string key in object: { 'throw-if-namespace': false }.
TypeError: Cannot read property 'call' of undefined
Decorator plugin not loaded or misconfigured, often due to missing 'decorators.legacy' option.
fix
Add 'decorators: { legacy: true }' to preset options.
Module not found: Can't resolve 'babel-preset-remax'
Package not installed or incorrect import path in Babel config.
fix
Install with `npm install --save-dev babel-preset-remax` and use 'remax' as preset name.
Upgrade
Version history
2.15.14latest on npm
Audit
Dependencies
@babel/corerequiredpeer dependency required for all Babel presets
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
babel-preset-remax — npm install babel-preset-remax · libregistry