{"id":20209,"library":"meteor-babel","title":"meteor-babel","description":"A Babel wrapper package designed specifically for use with the Meteor framework, currently at v7.13.0. It provides a pre-configured Babel compilation pipeline that integrates seamlessly with Meteor's build system, supporting ES6/ES7 transpilation, TypeScript, and various syntax transformations. Differentiators include Meteor-specific plugins, automatic dependency management, and compatibility with Meteor's module system. Release cadence is irregular, with major version bumps tied to Meteor updates. vs. plain Babel: adds Meteor-specific transforms and optimizations, eases configuration for Meteor projects.","status":"active","version":"7.10.7","language":"javascript","source_language":"en","source_url":"https://github.com/meteor/babel","tags":["javascript","meteor","babel","es6","es7","transpiler","transpilation","compilation","transform"],"install":[{"cmd":"npm install meteor-babel","lang":"bash","label":"npm"},{"cmd":"yarn add meteor-babel","lang":"bash","label":"yarn"},{"cmd":"pnpm add meteor-babel","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import is the main entry; CommonJS require also works but ESM preferred.","wrong":"const meteorBabel = require('meteor-babel')","symbol":"meteorBabel","correct":"import meteorBabel from 'meteor-babel'"},{"note":"Named export for compile function; tree-shakeable with ESM.","wrong":"const compile = require('meteor-babel').compile","symbol":"compile","correct":"import { compile } from 'meteor-babel'"},{"note":"setCacheDir is a named export, not a subpath export.","wrong":"import setCacheDir from 'meteor-babel/setCacheDir'","symbol":"setCacheDir","correct":"import { setCacheDir } from 'meteor-babel'"}],"quickstart":{"code":"import meteorBabel from 'meteor-babel';\nimport { compile } from 'meteor-babel';\n\nconst sourceCode = `\n  const x = (a, b) => a + b;\n  export default x;\n`;\n\n// Compile with default options\nconst result = compile(sourceCode, {});\nconsole.log(result.code);\n\n// Or use the meteorBabel object for more control\nconst babelInstance = new meteorBabel.Babel();\nconst transformed = babelInstance.transform(sourceCode, {\n  filename: 'test.js',\n  sourceMaps: true,\n});\nconsole.log(transformed.code);","lang":"typescript","description":"Shows how to import meteor-babel and use compile function and Babel class to transpile ES6 code."},"warnings":[{"fix":"Update your .babelrc or Babel configuration to explicitly include any missing plugins.","message":"In v7.11.0, default Babel plugins changed. Existing projects may break if relying on removed plugins.","severity":"breaking","affected_versions":">=7.11.0 <7.13.0"},{"fix":"Remove calls to setCacheDir(); no action needed.","message":"setCacheDir() is deprecated as of v7.12.0; caching is now automatic.","severity":"deprecated","affected_versions":">=7.12.0"},{"fix":"Upgrade Node.js to version 10 or higher.","message":"meteor-babel requires Node.js >= 10. Installing on older Node versions may fail silently.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Set 'loose' option explicitly in Babel config if relying on previous behavior.","message":"In v7.13.0, the 'loose' option for class transforms changed default behavior. See migration guide.","severity":"breaking","affected_versions":">=7.13.0"},{"fix":"Use the meteor-babel package only as a dependency for Meteor's build system, not for direct invocation.","message":"When using with Meteor, do not call compile() directly in production; use Meteor's build plugin.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install meteor-babel' and ensure import path is correct.","cause":"Package not installed or misspelled.","error":"Error: Cannot find module 'meteor-babel'"},{"fix":"Use 'import { compile } from 'meteor-babel''.","cause":"Importing default instead of named 'compile'.","error":"TypeError: meteorBabel.compile is not a function"},{"fix":"Ensure compile() is invoked on the source with correct options like { presets: ['meteor'] }.","cause":"Source code not transpiled; compile() not used or options missing.","error":"SyntaxError: Unexpected token =>"},{"fix":"Add a .babelrc file with presets/plugins or pass options to compile().","cause":"Missing Babel configuration.","error":"Error: Could not find any Babel presets or plugins"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}