Registry / web-framework / babel-preset-cozy-app

babel-preset-cozy-app

JSON →
library2.8.4jsnpmunverified

Babel preset for Cozy Cloud applications. Version 2.8.4 is the current stable release (last updated 2021, now in maintenance mode). It configures Babel with plugins and presets needed for Cozy apps, including environment-based presets (react, node) and specific plugins for Cozy's flags system and inline style imports. Differentiator: purpose-built for Cozy platform, with automatic configuration for their specific stack (e.g., cozy-flags, cozy-ui).

npm install babel-preset-cozy-app
INSTALL
IMPORT
SIG · BABEL-PRESET-COZY-
B
babel-preset-cozy-app
web-frameworkjavascriptv2.8.4
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-cozy-app')
import preset from 'babel-preset-cozy-app'
CJS-only package; ESM import not supported. Use require in .babelrc.js or babel.config.js.
cozy-app
module.exports = { presets: ['cozy-app'] }
module.exports = { presets: ['babel-preset-cozy-app'] }
Short name 'cozy-app' is the recommended preset name in Babel config, but full package name also works.
cozy-app/react
module.exports = { presets: [['cozy-app', { preset: 'react' }]] }
module.exports = { presets: ['cozy-app/react'] }
Sub-preset must be specified via options, not path. Since v2.

Shows typical usage in babel.config.js with React preset and polyfill options.

// babel.config.js module.exports = { presets: [ ['cozy-app', { preset: 'react', // options: 'react', 'node', 'react-native' targets: { browser: 'last 2 versions' }, useBuiltIns: 'usage', corejs: 3 }] ] };
Debug
Known issues
breakingv2 dropped support for Node < 10 and Babel 6. Use Babel 7+.
fix
Upgrade to Babel 7 and Node >=10.
affects: >=2.0.0 <3.0.0
deprecatedThe package is in maintenance mode; no new features. Consider migrating to @cozy/babel-preset-cozy-app if available.
fix
Check for replacement in cozy-libs monorepo.
affects: >=2.0.0
gotchaDo not use preset path 'cozy-app/react' - it will fail. Sub-presets must be configured via options.
fix
Use { presets: [['cozy-app', { preset: 'react' }]] }
affects: >=2.0.0
gotchaThe preset automatically includes @babel/plugin-transform-runtime. Ensure @babel/runtime is in dependencies.
fix
Add @babel/runtime to dependencies (not devDependencies).
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-cozy-app'
Package not installed or not in node_modules.
fix
npm install babel-preset-cozy-app --save-dev
Error: Plugin/Preset files are not allowed to export objects, only functions.
Using default import (ESM) instead of require().
fix
Use require() in babel.config.js, not import.
ReferenceError: regeneratorRuntime is not defined
Missing async/transform-runtime configuration.
fix
Add useBuiltIns: 'usage' and corejs:3 options, or add @babel/polyfill (deprecated).
Upgrade
Version history
2.8.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
babel-preset-cozy-app — npm install babel-preset-cozy-app · libregistry