2.0.1 • Published 23 days ago

babel-preset-kyt-core v2.0.1

Weekly downloads
3,334
License
Apache-2.0
Repository
github
Last release
23 days ago

babel-preset-kyt-core

npm

An opinionated Babel preset, best used with kyt. Check out the Options for how to extend polyfill your build targets.

This preset is used as a default if a kyt project does not include a .babelrc It is also included as part of babel-preset-kyt-react

To install: 1. npm install babel-preset-kyt-core --save 2. In babelrc:

```
{
  presets: [
    "babel-preset-kyt-core"
  ]
}
```

Options

(see documentation for Babel preset options)

  • envOptions (Object) - extend the default babel-preset-env options. The type of options, client, server, and test, are dependent on the value of process.env.KYT_ENV_TYPE which, when undefined, defaults to client. kyt will automatically set the KYT_ENV_TYPE when it runs commands. For debugging purposes, use "debug": true to see what the plugin is targeting. The following are the default babel-preset-env configurations used by kyt-core:

    • client
      modules: false,
      useBuiltIns: true,
      targets: {
        uglify: true,
        browsers: ['>1%', 'last 4 versions', 'not ie < 11'],
      },
    • server
      modules: false,
      useBuiltIns: true,
      targets: {
        node: 'current'
      },

    These are sensible defaults that work well with kyt out of the box. The client option, typically reserved for client builds in kyt, is used to target browsers, while the server option targets the current version of node. The client.targets.browsers configuration is in the browserlist format. The following is an example of how to override the option types in your babelrc configuration:

    {
      "presets": [
        [
          "babel-preset-kyt-core", {
            "envOptions": {
              "client": {
                "debug": true,
                "targets": {
                  "browsers": ["last 2 versions"]
                }
              },
              "server": {
                "debug": true,
                "modules": true
              },
            },
          },
        ],
      ],
    }

    You can find additional options to configure babel-preset-env here.

  • includeRuntime (Boolean) - whether or not to include babel-plugin-transform-runtime; default: false

Polyfilling

By default babel-preset-env, an internal dependency, is configured to useBuiltIns which means that you can install babel-polyfill as a dependency in your project and import 'babel-polyfill' at the top of your entry file (in a kyt project that would be src/client/index.js and src/server/index.js) to include an optimized polyfill for your build.

CHANGELOG

0.3.0 - XX/XX/XX

  • Adds babel-preset-env, removes babel-preset-latest

0.2.0 - 03/23/17

2.0.2-alpha.14

23 days ago

2.0.2-alpha.13

24 days ago

2.0.2-alpha.10

27 days ago

2.0.1

12 months ago

2.0.0

2 years ago

1.2.17-alpha.0

2 years ago

1.2.16

3 years ago

1.2.15

3 years ago

1.2.14

3 years ago

1.2.13

3 years ago

1.2.12

3 years ago

1.2.11

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.10

3 years ago

1.2.9

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta.40.1

4 years ago

1.0.0-beta.40.0

4 years ago

1.0.0-beta.39

4 years ago

1.0.0-beta.38

4 years ago

1.0.0-beta.37

4 years ago

1.0.0-beta.36

4 years ago

1.0.0-beta.35

4 years ago

1.0.0-beta.34

4 years ago

1.0.0-beta.33

4 years ago

1.0.0-beta.32

4 years ago

1.0.0-beta.31

4 years ago

1.0.0-beta.30

4 years ago

1.0.0-beta.29

4 years ago

1.0.0-beta.26

4 years ago

1.0.0-beta.27

4 years ago

1.0.0-beta.24

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.1

4 years ago

1.0.0-beta.0

4 years ago

1.0.0-alpha.18

4 years ago

1.0.0-alpha.17

4 years ago

1.0.0-hot.17

4 years ago

1.0.0-hot.18

4 years ago

1.0.0-hot.16

4 years ago

1.0.0-hot.15

4 years ago

1.0.0-alpha.9

4 years ago

1.0.0-alpha.8

4 years ago

1.0.0-alpha.7

4 years ago

1.0.0-alpha.6

4 years ago

1.0.0-alpha.5

4 years ago

1.0.0-alpha.4

4 years ago

1.0.0-alpha.3

4 years ago

1.0.0-alpha.2

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha.10

4 years ago

1.0.0-alpha.11

4 years ago

1.0.0-alpha.0

4 years ago

0.9.1-alpha.0

4 years ago

0.3.0

7 years ago

0.3.0-alpha.9

7 years ago

0.3.0-alpha.7

7 years ago

0.3.0-alpha.6

7 years ago

0.3.0-alpha.5

7 years ago

0.3.0-alpha.4

7 years ago

0.3.0-alpha.3

7 years ago

0.3.0-alpha.2

7 years ago

0.3.0-alpha.1

7 years ago

0.2.1-env-beta.2

7 years ago

0.2.1-env-beta.1

7 years ago

0.2.0

7 years ago

0.2.0-rc.1

7 years ago

0.1.0

7 years ago

0.1.0-alpha.1

7 years ago