or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

configuration-options.mdcore-addon-interface.mdindex.mdplugin-generation.mdutility-functions.md
tile.json

configuration-options.mddocs/

Configuration Options

ember-cli-babel provides extensive configuration options through two main configuration keys: ember-cli-babel for addon-specific settings and babel for direct Babel configuration.

Capabilities

ember-cli-babel Configuration

Options specific to ember-cli-babel's behavior and integration with Ember CLI.

interface EmberCLIBabelOptions {
  /** Include external Babel helpers to reduce bundle size (app-level only) */
  includeExternalHelpers?: boolean;
  /** Compile ES6 modules to AMD format */
  compileModules?: boolean;
  /** Disable debug macro processing for @ember/debug */
  disableDebugTooling?: boolean;
  /** Disable @babel/preset-env entirely */
  disablePresetEnv?: boolean;
  /** Disable Ember modules API polyfill */
  disableEmberModulesAPIPolyfill?: boolean;
  /** Disable EmberData packages polyfill */
  disableEmberDataPackagesPolyfill?: boolean;
  /** Disable decorator and class property transforms */
  disableDecoratorTransforms?: boolean;
  /** Enable TypeScript transpilation */
  enableTypeScriptTransform?: boolean;
  /** File extensions to process (default: ['js'] or ['js', 'ts']) */
  extensions?: string[];
  /** Use external babel.config.js instead of auto-generated config */
  useBabelConfig?: boolean;
  /** Annotation for broccoli-babel-transpiler */
  annotation?: string;
  /** Throw unless parallelizable for broccoli-babel-transpiler */
  throwUnlessParallelizable?: boolean;
}

Usage Examples:

// ember-cli-build.js - App configuration
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    includeExternalHelpers: true,
    enableTypeScriptTransform: true,
    disableDebugTooling: false,
    extensions: ['js', 'ts', 'gjs']
  }
});

// index.js - Addon configuration
module.exports = {
  options: {
    'ember-cli-babel': {
      compileModules: false,
      disableDecoratorTransforms: true
    }
  }
};

// index.js - Engine configuration
module.exports = EngineAddon.extend({
  'ember-cli-babel': {
    enableTypeScriptTransform: true
  }
});

babel Configuration

Direct Babel configuration options passed through to @babel/preset-env and Babel core.

interface BabelOptions {
  /** Enable spec compliance mode */
  spec?: boolean;
  /** Enable loose mode transformations for smaller/faster output */
  loose?: boolean;
  /** Enable debug logging */
  debug?: boolean;
  /** Force include specific transforms regardless of targets */
  include?: string[];
  /** Exclude specific transforms */
  exclude?: string[];
  /** Configure built-in polyfill usage */
  useBuiltIns?: boolean | 'entry' | 'usage';
  /** Source map generation */
  sourceMaps?: boolean | 'inline' | 'both';
  /** Generator options for code output */
  generatorOpts?: object;
  /** Additional Babel plugins */
  plugins?: BabelPlugin[];
  /** Additional post-transform plugins */
  postTransformPlugins?: BabelPlugin[];
}

Usage Examples:

// ember-cli-build.js - Babel configuration
let app = new EmberApp(defaults, {
  babel: {
    sourceMaps: 'inline',
    loose: true,
    exclude: ['transform-regenerator'],
    plugins: [
      require.resolve('babel-plugin-transform-object-rest-spread'),
      [require.resolve('babel-plugin-transform-runtime'), {
        version: '7.12.0',
        regenerator: false
      }]
    ]
  }
});

External Helpers Configuration

Configuration for including external Babel helpers to reduce bundle size.

interface ExternalHelpersConfig {
  /** Enable external helpers (app-level only) */
  includeExternalHelpers: boolean;
}

External helpers are only configurable at the app level and will reduce bundle size by sharing common Babel helper functions across modules.

Automatic Detection: ember-cli-babel automatically detects when helpers would be beneficial based on:

  • Usage of @ember-decorators/babel-transforms
  • Project size heuristics
  • Decorator usage patterns

Usage Examples:

// Explicitly enable external helpers
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    includeExternalHelpers: true
  }
});

// Explicitly disable external helpers
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    includeExternalHelpers: false
  }
});

TypeScript Configuration

Configuration for TypeScript transpilation support.

interface TypeScriptConfig {
  /** Enable TypeScript transpilation */
  enableTypeScriptTransform: boolean;
  /** File extensions to process when TypeScript is enabled */
  extensions?: string[];
}

TypeScript transpilation is automatically enabled when ember-cli-typescript >= 4.0 is detected. It can also be manually enabled.

Usage Examples:

// Manual TypeScript enabling in app
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    enableTypeScriptTransform: true,
    extensions: ['js', 'ts', 'gts']
  }
});

// Manual TypeScript enabling in addon
module.exports = {
  options: {
    'ember-cli-babel': {
      enableTypeScriptTransform: true
    }
  }
};

Debug Tooling Configuration

Configuration for debug macro processing and production stripping.

interface DebugToolingConfig {
  /** Disable debug macro processing entirely */
  disableDebugTooling: boolean;
}

When enabled (default), debug tooling provides:

  • Automatic stripping of @ember/debug statements in production
  • Support for @glimmer/env DEBUG flag
  • Deprecation and assertion handling

Usage Examples:

// Disable debug tooling
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    disableDebugTooling: true
  }
});

Module Compilation Configuration

Configuration for ES6 module compilation to AMD format.

interface ModuleCompilationConfig {
  /** Compile ES6 modules to AMD (default: auto-detected) */
  compileModules: boolean;
}

Module compilation is automatically enabled for Ember CLI versions > 2.12.0 unless explicitly disabled.

Usage Examples:

// Disable module compilation
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    compileModules: false
  }
});

// Force enable module compilation for older Ember CLI
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    compileModules: true
  }
});

External Babel Configuration

Configuration for using external babel.config.js files instead of auto-generated configuration.

interface ExternalBabelConfig {
  /** Use external babel.config.js file */
  useBabelConfig: boolean;
}

When enabled, ember-cli-babel will look for and use a babel.config.js file in the project root instead of generating its own configuration.

Usage Examples:

// ember-cli-build.js - Enable external Babel config
let app = new EmberApp(defaults, {
  'ember-cli-babel': {
    useBabelConfig: true
  }
});

// babel.config.js - External configuration
const { buildEmberPlugins } = require('ember-cli-babel');

module.exports = function(api) {
  api.cache(true);

  return {
    presets: [
      [require.resolve('@babel/preset-env'), {
        targets: require('./config/targets')
      }]
    ],
    plugins: [
      ...buildEmberPlugins(__dirname),
      require.resolve('my-custom-plugin')
    ]
  };
};

Configuration Inheritance

Configuration flows through the Ember CLI addon hierarchy:

  1. App-level configuration (ember-cli-build.js) - Highest priority
  2. Addon-level configuration (index.js options) - Addon-specific overrides
  3. Default configuration - Built-in defaults based on environment and dependencies

App-only Options:

  • includeExternalHelpers - Can only be configured at app level

Inherited Options: All other options are inherited through the addon tree, with more specific configurations overriding general ones.

Environment-Specific Behavior

Some configuration options behave differently based on the build environment:

Production Environment (EMBER_ENV=production):

  • Debug tooling is more aggressive in stripping debug statements
  • Source maps default to disabled
  • Helper inclusion heuristics favor smaller bundles

Development Environment (EMBER_ENV=development):

  • Debug tooling preserves all debug statements
  • Source maps can be enabled for debugging
  • Faster transpilation with loose mode defaults

Test Environment (EMBER_ENV=test):

  • Debug tooling preserves assertions but may strip deprecations
  • Optimized for test execution speed