Skip to content

Docs - Add plugin info for @ember/app-blueprint apps #609

Description

@TSenter

When using the @ember/app-blueprint for apps, the Babel config is its own file instead of part of the EmberApp object. The docs should be updated to reflect this:

@ember/app-blueprint v6.8

  const {
    babelCompatSupport,
    templateCompatSupport,
  } = require('@embroider/compat/babel');

  module.exports = {
    plugins: [
      [
        'babel-plugin-ember-template-compilation',
        {
          compilerPath: 'ember-source/dist/ember-template-compiler.js',
          enableLegacyModules: [
            'ember-cli-htmlbars',
            'ember-cli-htmlbars-inline-precompile',
            'htmlbars-inline-precompile',
          ],
          transforms: [...templateCompatSupport()],
        },
      ],
      [
        'module:decorator-transforms',
        {
          runtime: {
            import: require.resolve('decorator-transforms/runtime-esm'),
          },
        },
      ],
      [
        '@babel/plugin-transform-runtime',
        {
          absoluteRuntime: __dirname,
          useESModules: true,
          regenerator: false,
        },
      ],
+     require.resolve('ember-concurrency/async-arrow-task-transform'),
      ...babelCompatSupport(),
    ],

    generatorOpts: {
      compact: false,
    },
  };

@ember/app-blueprint v6.10

  import { dirname } from 'node:path';
  import { fileURLToPath } from 'node:url';
  import {
    babelCompatSupport,
    templateCompatSupport,
  } from '@embroider/compat/babel';

  export default {
    plugins: [
      [
        'babel-plugin-ember-template-compilation',
        {
          enableLegacyModules: [
            'ember-cli-htmlbars',
            'ember-cli-htmlbars-inline-precompile',
            'htmlbars-inline-precompile',
          ],
          transforms: [...templateCompatSupport()],
        },
      ],
      [
        'module:decorator-transforms',
        {
          runtime: {
            import: import.meta.resolve('decorator-transforms/runtime-esm'),
          },
        },
      ],
      [
        '@babel/plugin-transform-runtime',
        {
          absoluteRuntime: dirname(fileURLToPath(import.meta.url)),
          useESModules: true,
          regenerator: false,
        },
      ],
+     import.meta.resolve('ember-concurrency/async-arrow-task-transform'),
      ...babelCompatSupport(),
    ],

    generatorOpts: {
      compact: false,
    },
  };

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions