Registry / web-framework / babel-preset-enact

babel-preset-enact

JSON →
library0.1.16jsnpmunverified

Babel preset used by the Enact framework for building React-based applications. Current stable version is 0.1.16, with maintenance releases updating dependencies. It provides a pre-configured set of Babel plugins and presets optimized for Enact projects. Key differentiators include tailored support for Enact's component model and seamless integration with Enact CLI, which includes it by default. For non-Enact projects, it can be installed separately to leverage similar transforms. Releases are infrequent, focusing on dependency updates rather than feature additions.

npm install babel-preset-enact
INSTALL
IMPORT
SIG · BABEL-PRESET-ENACT
B
babel-preset-enact
web-frameworkjavascriptv0.1.16
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
module.exports = require('babel-preset-enact')
import Preset from 'babel-preset-enact'
ESM import is not supported; use CommonJS require or configure in .babelrc as a string preset name.
Configuration
{ "presets": ["babel-preset-enact"] }
{ "presets": ["enact"] }
In .babelrc, use the full package name 'babel-preset-enact', not the short 'enact'.
env
{ "presets": ["babel-preset-enact", "module:preset-env"] }
{ "presets": ["babel-preset-enact", "@babel/preset-env"] }
When combining presets, ensure correct ordering and avoid redundant preset-env inclusion.

Shows how to install and configure babel-preset-enact in a non-Enact CLI project, including a basic React component.

// Install dependencies npm install --save-dev babel-preset-enact @babel/core // Create .babelrc in project root { "presets": ["babel-preset-enact"] } // Sample React component using Enact import kind from '@enact/core/kind'; import Button from '@enact/agate/Button'; const MyApp = kind({ name: 'MyApp', render: () => ( <div> <Button>Click me</Button> </div> ) }); export default MyApp; // Build with Babel npx babel src --out-dir lib
Debug
Known issues
deprecatedDeprecated Babel plugins included
fix
Update to version 0.1.10 or later to remove deprecated plugins like @babel/plugin-transform-react-inline-elements.
affects: >=0.1.0 <0.1.10
gotchaThis preset is designed specifically for Enact projects. Using it with non-Enact React apps may result in unexpected behavior or missing configuration.
fix
Ensure your project depends on @enact/core and other Enact packages, or use a more generic preset like @babel/preset-react.
affects: all
breakingRemoval of @babel/plugin-transform-react-inline-elements in 0.1.10 causes production build errors with React 19
fix
Upgrade React to a version compatible with the removal, or if using React 19, consider adding the plugin back manually.
affects: >=0.1.10
breakingReplaced deprecated ESLint rules with @stylistic/js rules in version 0.1.8
fix
Update your ESLint config to use @stylistic/js rules if you rely on the replaced rules.
affects: >=0.1.8
deprecatedThe package babel-preset-enact may be superseded by built-in Babel configuration in Enact CLI
fix
For Enact CLI projects, do not install this preset separately; the CLI includes it automatically.
affects: all
Errors
Common errors & fixes
Error: Cannot find module '@babel/preset-enact'
Using incorrect preset name in .babelrc
fix
Use full package name: "babel-preset-enact" instead of just "enact".
Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: [BABEL] ...: Preset .enact requires a module of type 'object' but got 'string'
Invalid configuration format or missing require statement
fix
In .babelrc, ensure presets array contains strings, not objects. Example: { "presets": ["babel-preset-enact"] }
SyntaxError: Unexpected token (1:1) > 1 | import kind from '@enact/core/kind'; | ^
Babel is not transpiling ES modules, possibly due to missing preset or incorrect configuration
fix
Ensure .babelrc includes 'babel-preset-enact' and that @babel/core is installed.
Upgrade
Version history
0.1.16latest on npm
Audit
Dependencies
@babel/corerequiredPeer dependency required for Babel preset to function
@babel/preset-envrequiredCore preset for environment-specific transpilation
@babel/preset-reactrequiredRequired for JSX and React-specific transforms
@babel/plugin-proposal-class-propertiesrequiredUsed for transforming class properties
@babel/plugin-proposal-object-rest-spreadrequiredUsed for transforming object rest/spread properties
@babel/plugin-transform-runtimeoptionalHelps avoid duplication of helpers and polyfills
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
babel-preset-enact — npm install babel-preset-enact · libregistry