Skip to main content
The ecmascript package provides ES2015+ (ES6 and beyond) JavaScript support in Meteor applications through Babel compilation.

Installation

The ecmascript package is included by default in all Meteor applications.

Overview

The ecmascript package provides:
  • ES2015+ Support - Arrow functions, classes, async/await, and more
  • Babel Compilation - Automatic transpilation to browser-compatible code
  • Modern JavaScript - Use the latest language features
  • Module System - ES6 import/export statements
  • React Fast Refresh - Hot reloading for React components
  • Source Maps - Debug original source code

Package Information

  • Version: 0.17.0
  • Summary: Compiler plugin that supports ES2015+ in all .js files
  • Dependencies: babel-compiler, babel-runtime, modules, promise, dynamic-import
  • NPM: @babel/runtime@7.20.7

Supported Features

ES2015 (ES6)

ES2016+

Module System

Import Statements

Export Statements

Async/Await

With Meteor Methods

With Collections

Parallel Operations

Class Properties

React Support

ECMAScript package includes React Fast Refresh:

Dynamic Import

Babel Configuration

Default Configuration

The package includes sensible defaults:

Custom Babel Config

Create .babelrc or babel.config.js:

Modern vs Legacy Bundles

Meteor automatically creates two bundles:

Source Maps

Debug original source code:

Best Practices

Use const by default - Only use let when reassignment is needed
Prefer arrow functions - Especially for callbacks
Use async/await - More readable than promise chains
Destructure imports - Import only what you need

Common Patterns

Async Meteor Startup

Export Collections

Async Publications

Performance

The ecmascript package optimizes builds:
  • Tree shaking - Remove unused code
  • Minification - Smaller production bundles
  • Code splitting - Load code on demand
  • Caching - Fast rebuilds during development

Debugging

typescript

TypeScript compiler for Meteor

babel-compiler

Babel compilation engine

modules

ES6 module system

dynamic-import

Dynamic import() support

Source Code