Registry / web-framework / babel-preset-rsmax

babel-preset-rsmax

JSON →
library1.3.14jsnpmunverified

Babel preset for Remax, a framework for building mini-programs (WeChat, Alipay, etc.) with React. This package (v1.3.14, stable, actively maintained) provides a pre-configured Babel transform pipeline for Remax projects, including JSX handling, TypeScript support, and environment-specific optimizations. Differentiates from generic Babel presets by tailoring transforms for mini-program runtime constraints and Remax's React-like API.

npm install babel-preset-rsmax
INSTALL
IMPORT
SIG · BABEL-PRESET-RSMAX
B
babel-preset-rsmax
web-frameworkjavascriptv1.3.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-rsmax');
import preset from 'babel-preset-rsmax';
CommonJS only; preset is used in babel.config.js, which is typically CJS.

Configure Babel with the Remax preset for WeChat mini-programs, enabling TypeScript and removing propTypes in production.

// babel.config.js module.exports = { presets: [ ['babel-preset-rsmax', { pluginTarget: 'wechat', // or 'alipay', 'toutiao', etc. typescript: true, removePropTypes: process.env.NODE_ENV === 'production' }] ] };
Debug
Known issues
gotchaPreset options must be passed as an array, e.g., ['babel-preset-rsmax', { ... }]. Omitting options can cause unexpected behavior.
fix
Always use array syntax with options object, even if empty: ['babel-preset-rsmax', {}]
affects: >=1.0.0
breakingVersion 2.x removed support for React Native and focuses only on mini-programs. Existing projects may break if they rely on the old behavior.
fix
Update your project to target mini-programs only, or stick with v1.x if you need React Native support.
affects: >=2.0.0
deprecatedThe `importStyle` option was deprecated in v1.2.0 and removed in v2.0.0. Avoid using it.
fix
Remove `importStyle` from preset options. Use separate Babel plugins for style imports if needed.
affects: >=1.2.0 <2.0.0
gotchaThe preset may not work with Babel versions <7.4.0 due to dependency on `@babel/helper-plugin-utils`.
fix
Upgrade @babel/core to at least 7.4.0.
affects: >=7.0.0 <7.4.0
Errors
Common errors & fixes
Cannot find module 'babel-preset-rsmax'
The package is not installed or is not in node_modules.
fix
Run 'npm install babel-preset-rsmax --save-dev' or 'yarn add babel-preset-rsmax --dev'.
TypeError: Cannot read property 'bind' of undefined
Incorrect usage of preset with object spread without proper configuration.
fix
Ensure you pass options as object in array: ['babel-preset-rsmax', { pluginTarget: 'wechat' }]
Error: Cannot find module '@babel/core'
@babel/core is not installed.
fix
Run 'npm install @babel/core --save-dev'.
SyntaxError: Unexpected token (1:1)
Using wrong file extension or missing parser plugins.
fix
Make sure your file has extension .js/.jsx/.ts/.tsx and that Babel is configured with correct presets.
Upgrade
Version history
1.3.14latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency required for Babel transformations.
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
babel-preset-rsmax — npm install babel-preset-rsmax · libregistry