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: 'entry',
forceAllTransforms: true,
targets: {
browsers: ['>1%', 'last 4 versions', 'not ie < 11'],
},
server
modules: false,
useBuiltIns: 'entry',
forceAllTransforms: 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 browserslist 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.