@seamly/babel-preset

1.1.0 • Public • Published

Seamly Babel-Preset

This is the default babel-preset for @seamly/* implementations.

Installation

yarn add -D @seamly/babel-preset
// or
npm install -D @seamly/babel-preset

Default Options

{
  env: undefined,
  transforms: {
    jsx: {
      runtime: 'automatic',
      importSource: 'preact',
    },
    runtime: {
      absoluteRuntime: true,
      helpers: true,
      corejs: 3,
      regenerator: true,
      useESModules: true,
    },
  },
}

Presets

@babel/preset-env can be enabled by providing preset options

Transforms

The following transforms are enabled by default, with default options, and can be disabled by providing false or modified by providing options which will be merged.

Disabling transforms

Transforms can be disabled by providing false:

{
  transforms: {
    jsx: false
  }
}

Configuring options

Transforms can be configured with custom options by providing an object, which will be merged with the default options:

{
  transforms: {
    jsx: {
      importSource: 'react'
    }
  }
}

Usage

This package can be used as @seamly/babel-preset following the Babel documentation on Presets.

Within babel.config.js / .babelrc.js

module.exports = {
  ...
  presets: [
    '@seamly/babel-preset',
    ['@seamly/babel-preset', {
      // options
    }]
  ]
  ...
}

Within webpack.config.js

  {
    loader: 'babel-loader',
    options: {
      presets: [
        '@seamly/babel-preset'
      ]
    }
  }

Readme

Keywords

Package Sidebar

Install

npm i @seamly/babel-preset

Weekly Downloads

35

Version

1.1.0

License

MIT

Unpacked Size

5.7 kB

Total Files

6

Last publish

Collaborators

  • adrianeggerdesign
  • jarnovanrhijn
  • flurinegger
  • ronaldwind
  • sandervink