@motork/babel-preset-webspark

1.0.0 • Public • Published

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"]
}

Package Sidebar

Install

npm i @motork/babel-preset-webspark

Weekly Downloads

244

Version

1.0.0

License

ISC

Unpacked Size

4.75 kB

Total Files

4

Last publish

Collaborators

  • cristian.frumusanu.motork
  • motork-user
  • davidet16
  • davidefavia.motork
  • drivek-ske
  • paolo.cavanna