@motork/babel-preset-webspark
v1.0.0
Published
This repo contains a default base configuration for Babel JavaScript compiler used by Webspark and related projects.
Downloads
351
Readme
Babel Configuration
This repo contains a default base configuration for Babel JavaScript compiler used by WebSparK and related projects.
How to use it
The recommended way is to have a babel.config.js
file exporting the desired configuration and, if needed, augmenting it.
Example:
module.exports = {
presets: [
[
"@motork/babel-preset-motork",
{
debug: true
}
]
],
env: {
test: {
presets: [
[
"@babel/preset-env",
{
targets: {
node: 8
}
}
]
]
}
}
};
Here you're using WebSpark's preset, passing in a debug
option overriding the default one and then you add a env
key, specific to the project you're working on (the env
key, for example, is required by Jest to work).
Please note that the preferred way to configure targets is by extending a Browserslist configuration in the browserslist
key of your app's package.json
, something like:
{
"browserslist": ["extends @motork/browserslist-config-webspark"]
}