Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rename] kbn-babel-preset package to osd-babel-preset #52

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @kbn/babel-preset
# @osd/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](https://www.elastic.co/support/matrix#matrix_browsers).

Expand All @@ -7,15 +7,15 @@ This package contains the shared bits of babel config that we use for transpilin
To use our presets add the following to the devDependencies section of your package.json:

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

Then run `yarn kbn bootstrap` to properly link the package into your plugin/package.
Then run `yarn osd 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.
Finally, add either `@osd/babel-preset/node_preset` or `@osd/babel-preset/webpack_preset` to your babel config.

`@kbn/babel-preset/node_preset` is usually placed in a [`babel.config.js` file](https://babeljs.io/docs/en/configuration#babelconfigjs).
`@osd/babel-preset/node_preset` is usually placed in a [`babel.config.js` file](https://babeljs.io/docs/en/configuration#babelconfigjs).

`@kbn/babel-preset/webpack_preset` is usually placed directly in your `webpack` configuration.
`@osd/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.
***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 `@osd/i18n` to see how that can look.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module.exports = (_, options = {}) => {
targets: {
// only applies the necessary transformations based on the
// current node.js processes version. For example: running
// `nvm install 8 && node ./src/cli` will run kibana in node
// version 8 and babel will stop transpiling async/await
// `nvm install 8 && node ./src/cli` will run OpenSearch Dashboards
// in node version 8 and babel will stop transpiling async/await
// because they are supported in the "current" version of node
node: 'current',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@kbn/babel-preset",
"name": "@osd/babel-preset",
"version": "1.0.0",
"private": true,
"license": "Apache-2.0",
"kibana": {
"opensearchDashboards": {
"devOnly": true
},
"dependencies": {
Expand Down