@rescripts/rescript-use-babel-config

0.0.12 • Public • Published

@rescripts/rescript-use-babel-config

About

Use your own Babel configuration. You probably want to use the Create React App babel config as a starting point:

{
  "plugins": [
    [
      "babel-plugin-named-asset-import",
      {
        "loaderMap": {
          "svg": {
            "ReactComponent": "@svgr/webpack?-svgo,+titleProp,+ref![path]"
          }
        }
      }
    ]
  ],
  "presets": [
    [
      "react-app",
      {
        "runtime": "automatic"
      }
    ]
  ]
}

Installation

npm i -D @rescripts/rescript-use-babel-config

Usage

From a .babelrc:

[["use-babel-config", ".babelrc"]]

Searches for the config in your root directory.

From config file

Call use-babel-config with .babelrc.js, .babelrc.json, or any other file name (must have .js or .json extension).

[["use-babel-config", "name-your-babel-config-whatever.js"]]

Searches for the config from your root directory and node_modules.

From package.json

[["use-babel-config", "package"]]

Searches for the config within the babel field of your package.json.

Inline config

[
  [
    "use-babel-config",
    {
      "presets": ["react-app"],
      "plugins": ["some-plugin"]
    }
  ]
]

Readme

Keywords

none

Package Sidebar

Install

npm i @rescripts/rescript-use-babel-config

Weekly Downloads

2,557

Version

0.0.12

License

MIT

Unpacked Size

4.6 kB

Total Files

4

Last publish

Collaborators

  • harrysolovay