close

Filter

loading table of contents...

Frontend Developer Manual / Version 2301

Table Of Contents

5.11 Customizing the Babel Configuration of a Theme

Babel is used to compile ECMA Script of the Frontend Workspace into a form that can be understood by all browsers a theme should support (see Section 4.11, “Browser Support”).

If you need to customize our default babel configuration you can to this the same way as Section 5.9, “Customizing the Webpack Configuration of a Theme” but in this case you need to add a file named babel.config.js to the theme's root folder.

const { babelConfig } = require("@coremedia/theme-utils");

module.exports = api => {
  const config = babelConfig(api);

  // ...

  return config;
};

The imported method babelConfig will generate our default configuration provided by the package @coremedia/theme-utils. You can simply extend this configuration by modifying the JavaScript Object that is returned by the function.

You can find more information about the configuration by checking the Babel Documentation.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.