{"id":19334,"library":"babel-preset-rsmax","title":"babel-preset-rsmax","description":"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.","status":"active","version":"1.3.14","language":"javascript","source_language":"en","source_url":"https://github.com/remaxjs/remax","tags":["javascript","typescript"],"install":[{"cmd":"npm install babel-preset-rsmax","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-rsmax","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-rsmax","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Babel transformations.","package":"@babel/core","optional":false}],"imports":[{"note":"CommonJS only; preset is used in babel.config.js, which is typically CJS.","wrong":"import preset from 'babel-preset-rsmax';","symbol":"default","correct":"module.exports = require('babel-preset-rsmax');"}],"quickstart":{"code":"// babel.config.js\nmodule.exports = {\n  presets: [\n    ['babel-preset-rsmax', {\n      pluginTarget: 'wechat', // or 'alipay', 'toutiao', etc.\n      typescript: true,\n      removePropTypes: process.env.NODE_ENV === 'production'\n    }]\n  ]\n};","lang":"javascript","description":"Configure Babel with the Remax preset for WeChat mini-programs, enabling TypeScript and removing propTypes in production."},"warnings":[{"fix":"Always use array syntax with options object, even if empty: ['babel-preset-rsmax', {}]","message":"Preset options must be passed as an array, e.g., ['babel-preset-rsmax', { ... }]. Omitting options can cause unexpected behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update your project to target mini-programs only, or stick with v1.x if you need React Native support.","message":"Version 2.x removed support for React Native and focuses only on mini-programs. Existing projects may break if they rely on the old behavior.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Remove `importStyle` from preset options. Use separate Babel plugins for style imports if needed.","message":"The `importStyle` option was deprecated in v1.2.0 and removed in v2.0.0. Avoid using it.","severity":"deprecated","affected_versions":">=1.2.0 <2.0.0"},{"fix":"Upgrade @babel/core to at least 7.4.0.","message":"The preset may not work with Babel versions <7.4.0 due to dependency on `@babel/helper-plugin-utils`.","severity":"gotcha","affected_versions":">=7.0.0 <7.4.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install babel-preset-rsmax --save-dev' or 'yarn add babel-preset-rsmax --dev'.","cause":"The package is not installed or is not in node_modules.","error":"Cannot find module 'babel-preset-rsmax'"},{"fix":"Ensure you pass options as object in array: ['babel-preset-rsmax', { pluginTarget: 'wechat' }]","cause":"Incorrect usage of preset with object spread without proper configuration.","error":"TypeError: Cannot read property 'bind' of undefined"},{"fix":"Run 'npm install @babel/core --save-dev'.","cause":"@babel/core is not installed.","error":"Error: Cannot find module '@babel/core'"},{"fix":"Make sure your file has extension .js/.jsx/.ts/.tsx and that Babel is configured with correct presets.","cause":"Using wrong file extension or missing parser plugins.","error":"SyntaxError: Unexpected token (1:1)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}