babel-preset-meteor

raw JSON →
8.0.3 verified Sat Apr 25 auth: no javascript maintenance

Babel preset for Meteor's build system, enabling ES2015+ syntax and features supported by Meteor's runtime. Current stable version is 8.0.3. This preset is specifically designed for Meteor plugins and applications, providing transforms and polyfills that align with Meteor's version of Node.js and browser targets. Unlike generic presets like @babel/preset-env, babel-preset-meteor includes Meteor-specific transforms (e.g., object-assign, regenerator, dynamic import) and avoids unnecessary transformations already handled by Meteor's compilation pipeline. Release cadence is tied to Meteor releases; note that this package has been in maintenance mode since Meteor 2.0, with newer projects typically using Meteor's built-in Babel configuration or @babel/preset-env directly.

error Error: Cannot find module 'babel-preset-meteor'
cause The preset is not installed or Babel cannot resolve it.
fix
Run 'npm install --save-dev babel-preset-meteor' from the project root.
error Error: Requires Babel "^7.0.0-0", but was loaded with "6.x.x"
cause Mismatched Babel versions: preset expects Babel 7 but old babel-core 6 is installed.
fix
Install @babel/core (Babel 7) and uninstall babel-core if present.
error ReferenceError: regeneratorRuntime is not defined
cause Missing @babel/runtime package which provides the async generator helper.
fix
Install @babel/runtime: 'npm install @babel/runtime'.
breaking babel-preset-meteor 8.x requires Babel 7 (i.e., @babel/core). It is incompatible with older babel-core 6.x.
fix Upgrade to @babel/core (Babel 7) and use babel-preset-meteor@8 or later.
deprecated This preset is in maintenance mode. Meteor's official recommendation for new projects is to use @babel/preset-env with appropriate targets.
fix For new projects, consider using @babel/preset-env directly and configure targets based on Meteor's Meteor.userConfig().
gotcha The preset automatically includes @babel/plugin-transform-runtime. Ensure @babel/runtime is installed as a dependency.
fix Add @babel/runtime to your dependencies or devDependencies if not already present.
npm install babel-preset-meteor
yarn add babel-preset-meteor
pnpm add babel-preset-meteor

Demonstrates installation and basic configuration of babel-preset-meteor via .babelrc and CLI.

// Install: npm install --save-dev babel-preset-meteor
// Create .babelrc in project root, or in a package directory
{
  "presets": ["meteor"]
}
// Then run Babel on your files:
// babel src/ --out-dir lib --presets meteor