A collection of Babel plugins for optimizing Rax mini-program (MiniApp) applications, version 0.2.0. These plugins enable pre-compilation analysis to determine used lifecycle methods, built-in components, and native/npm components, reducing runtime overhead and eliminating dead code. Part of the Rax MiniApp ecosystem, maintained for Alibaba-affiliated mini-program platforms. Key differentiator: performance optimization via compile-time introspection, avoiding full lifecycle registration and component tree traversal common in alternative solutions. Last updated 2022-05-17, with maintenance focused on bug fixes (event handling, WeChat map component).
npm install rax-miniapp-babel-pluginsVerified import paths — ran on the pinned version, not inferred.
Shows how to configure Babel with NativeLifeCycle and UsedBuiltInComponents plugins for Rax MiniApp optimization.
Upgrade to Babel 7 and use version 0.2.0 of this package.
Consider using `rax-miniapp-runtime-webpack-plugin` instead for automated configuration.
Ensure the plugins array order in babel.config.js matches documentation.
Verify your target platform is supported; if not, seek alternative optimization methods.
Use standard Rax lifecycle names: `onShow`, `onHide`, `onLoad`, etc.
Run `npm install rax-miniapp-babel-plugins --save-dev` and ensure path is correct.
Use `require('rax-miniapp-babel-plugins').NativeLifeCycle` instead of `require('rax-miniapp-babel-plugins')` directly.Ensure version >=0.2.0; if not, update package. Check package.json "main" field.