Registry / web-framework / babel-preset-mobx

babel-preset-mobx

JSON →
library2.0.0jsnpmunverified

Babel preset for ES features commonly used with MobX. Current stable version 2.0.0, last updated 2017, no recent releases. Includes transform-decorators-legacy, transform-class-properties, transform-es2015-classes, transform-regenerator. Requires babel-polyfill or regenerator-runtime for async/generators. Outdated and unmaintained; users should migrate to modern Babel (v7+) with individual @babel/plugin proposals or a custom preset. Does not support current MobX 6+ decorator syntax.

npm install babel-preset-mobx
INSTALL
IMPORT
SIG · BABEL-PRESET-MOBX
B
babel-preset-mobx
web-frameworkjavascriptv2.0.0
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.

preset
// .babelrc: { "presets": ["mobx"] }
import 'babel-preset-mobx' // not meant for direct import
Preset is configured in Babel config, not imported in code.
decorator support
// Use babel-preset-mobx in .babelrc
import { transformDecoratorsLegacy } from 'babel-preset-mobx'
Plugins are bundled, not individually exported.
regenerator
// need to add regenerator-runtime as dependency
// assumed included in preset, but it's not
babel-preset-mobx includes transform-regenerator but not the runtime.

Install and configure babel-preset-mobx with .babelrc for MobX projects.

npm install --save-dev babel-preset-mobx # Add to .babelrc: { "presets": ["mobx"] }
Debug
Known issues
deprecatedbabel-preset-mobx is outdated and unmaintained; not compatible with Babel 7+.
fix
Use @babel/preset-env and add required plugins manually for Babel 7+.
affects: >=2.0.0
gotchababel-polyfill or regenerator-runtime must be installed separately for async/generators.
fix
Install babel-polyfill or regenerator-runtime as a runtime dependency.
affects: >=2.0.0
gotchaIncluded plugins (transform-decorators-legacy) are deprecated in Babel 7+.
fix
Use @babel/plugin-proposal-decorators and @babel/plugin-proposal-class-properties.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Plugin/Preset files are not allowed to export objects, only functions.
Using this preset with Babel 7+ which expects functions, not legacy plugin objects.
fix
Upgrade to a Babel 7 compatible preset or use @babel/preset-env with manual plugins.
ReferenceError: regeneratorRuntime is not defined
Missing regenerator-runtime runtime dependency for async functions.
fix
Install regenerator-runtime and import it at the entry point.
Support for the experimental syntax 'decorators-legacy' isn't currently enabled
Babel 7 requires explicit plugin for decorators.
fix
Add @babel/plugin-proposal-decorators with legacy: true to Babel config.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
babel-polyfilloptionalrequired for async/generator functions at runtime
regenerator-runtimeoptionalalternative to babel-polyfill for async/generators
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
babel-preset-mobx — npm install babel-preset-mobx · libregistry