{"id":25116,"library":"constellate-plugin-compiler-babel","title":"Constellate Babel Compiler Plugin","description":"A Babel compiler plugin for Constellate projects, Version 0.14.0. This plugin integrates Babel into the Constellate build pipeline, allowing transformation of JavaScript/TypeScript code. It is part of the Constellate monorepo and is released on npm. Use it to transpile modern JS to older syntax as part of a Constellate build. Alternatives include other compiler plugins like TypeScript or Terser. Note: This is a plugin meant to be used with the Constellate CLI, not standalone.","status":"active","version":"0.14.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install constellate-plugin-compiler-babel","lang":"bash","label":"npm"},{"cmd":"yarn add constellate-plugin-compiler-babel","lang":"bash","label":"yarn"},{"cmd":"pnpm add constellate-plugin-compiler-babel","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Babel core is required for compilation","package":"@babel/core","optional":false},{"reason":"Primary Constellate package, peer dependency","package":"constellate","optional":true}],"imports":[{"note":"ESM-only package, named export also available.","wrong":"const babel = require('constellate-plugin-compiler-babel')","symbol":"babel","correct":"import babel from 'constellate-plugin-compiler-babel'"},{"note":"Named export is the same as default.","wrong":"const { babel } = require('constellate-plugin-compiler-babel')","symbol":"babel","correct":"import { babel } from 'constellate-plugin-compiler-babel'"},{"note":"Alternative named export for direct compilation.","symbol":"compile","correct":"import { compile } from 'constellate-plugin-compiler-babel'"}],"quickstart":{"code":"import babel from 'constellate-plugin-compiler-babel';\nimport constellate from 'constellate';\nconst config = {\n  plugins: [babel({ presets: ['@babel/preset-env'] })]\n};\nconst result = await constellate.compile('src/index.js', config);\nconsole.log(result.code);\n","lang":"typescript","description":"Demonstrates importing the Babel plugin and using it with Constellate to compile a JavaScript file with @babel/preset-env."},"warnings":[{"fix":"Use the plugin with Constellate's compile function.","message":"This plugin is meant to be used as part of Constellate, not as a standalone Babel wrapper. It does not expose a direct Babel API.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Follow Constellate releases for migration.","message":"The package uses an older naming convention and might be renamed in future Constellate versions.","severity":"deprecated","affected_versions":"0.14.0"},{"fix":"Run npm install @babel/core.","message":"Ensure @babel/core is installed in your project, as it's a peer dependency.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install @babel/core","cause":"@babel/core is not installed.","error":"Error: Cannot find module '@babel/core'"},{"fix":"Use import babel from 'constellate-plugin-compiler-babel'.","cause":"Importing incorrectly (e.g., default vs named).","error":"TypeError: babel is not a function"},{"fix":"Pass presets as array, e.g., babel({ presets: ['@babel/preset-env'] })","cause":"Presets not passed correctly to babel() call.","error":"Plugin configuration error: Babel presets not applied"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}