kibana/packages/kbn-babel-preset
Spencer eaf70a0b4e
[kbn/ui-shared-deps] split into two packages (#110558)
* [kbn/ui-shared-deps] split into two packages

* fix asset categorizer

* update snapshots

* reference npm dll from optimizer

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-09-16 12:06:46 -07:00
..
BUILD.bazel chore(NA): enables @babel/plugin-transform-runtime to decrease output size (#109843) 2021-08-25 22:24:38 +01:00
common_babel_parser_options.js
common_preset.js chore(NA): enables @babel/plugin-transform-runtime to decrease output size (#109843) 2021-08-25 22:24:38 +01:00
istanbul_preset.js
node_preset.js
package.json
README.md
styled_components_files.js [kbn/ui-shared-deps] split into two packages (#110558) 2021-09-16 12:06:46 -07:00
webpack_preset.js chore(NA): moving @kbn/es-query to babel transpiler (#107281) 2021-07-30 18:38:02 +01: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.