kibana/packages/kbn-babel-preset
Jon 2d2833d8d6
[7.17] Upgrade babel to ^7 (#174003)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-01-02 11:01:07 -06:00
..
BUILD.bazel chore(NA): enables @babel/plugin-transform-runtime to decrease output size (#109843) (#110157) 2021-08-25 20:34:56 -04:00
common_babel_parser_options.js [7.x] Elastic License 2.0 (#90192) 2021-02-03 18:39:13 -08:00
common_preset.js [7.17] Upgrade babel to ^7 (#174003) 2024-01-02 11:01:07 -06:00
node_preset.js [7.16] Update babel (main) (#118741) (#118956) 2021-11-17 17:51:53 -07:00
package.json [7.x] Elastic License 2.0 (#90192) 2021-02-03 18:39:13 -08:00
README.md [kbn/babel-preset] add readme (#39854) 2019-06-28 11:09:48 -07:00
styled_components_files.js [7.17] chore(NA): rename @elastic/eslint-config-kibana as @kbn/eslint-config (#132278) (#132286) 2022-05-16 15:33:52 -07:00
webpack_preset.js [7.16] Update babel (main) (#118741) (#118956) 2021-11-17 17:51:53 -07:00

@kbn/babel-preset

This package contains the shared bits of babel config that we use for transpiling our source code to code compatible with Node.JS and the various browsers we support.

usage

To use our presets add the following to the devDependencies section of your package.json:

"@kbn/babel-preset": "1.0.0",

Then run yarn kbn bootstrap to properly link the package into your plugin/package.

Finally, add either @kbn/babel-preset/node_preset or @kbn/babel-preset/webpack_preset to your babel config.

@kbn/babel-preset/node_preset is usually placed in a babel.config.js file.

@kbn/babel-preset/webpack_preset is usually placed directly in your webpack configuration.

NOTE: If you're transpiling code that will be run in both the browser and node you must transpile your code twice, once for each target. Take a look at the build tasks for @kbn/i18n to see how that can look.