kibana/packages/kbn-babel-preset
Tyler Smalley c675301a87
[build] Removes commonjs transforms (#66506)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-21 09:43:31 -07:00
..
common_babel_parser_options.js autofix all violations 2019-12-13 23:17:13 -07:00
common_preset.js Update babel-typescript config (#53108) 2019-12-16 19:28:54 +01:00
istanbul_preset.js autofix all violations 2019-12-13 23:17:13 -07:00
node_preset.js chore(NA): use the same polyfill between the dev environment and the jest env (#57467) 2020-02-12 18:36:29 +00:00
package.json [build] Removes commonjs transforms (#66506) 2020-05-21 09:43:31 -07:00
README.md [kbn/babel-preset] add readme (#39854) 2019-06-28 11:06:46 -07:00
webpack_preset.js [build] Removes commonjs transforms (#66506) 2020-05-21 09:43:31 -07:00
yarn.lock Add lockfile symlinks (#55440) 2020-01-27 11:38:20 -05: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.