Skip to content

Are you open to allowing .babelrc.js? #4630

@vvo

Description

@vvo

The only place I saw "I'd like to use JavaScript inside .babelrc is here: #4449, so I am opening a proper issue about .babelrc.js.

Expected Behavior

I would like to be able to provide:

.babelrc.js

module.exports = {
  plugins: [
    ["babel-plugin-transform-cool", {
      isCool: maybe => maybe ? 'yes' : 'no';
    }]
  ]
};

And use the isCool option in the plugin like so: state.opts.isCool(true);

Current Behavior

.babelrc only allows for JSON.

Possible Solution

Use babel-core programmatically, this allows for any type of option (which may be seen as non-consistent with .babelrc).

Context

ESLint allows this, I find it easier to reason about configuration files when they are written with JavaScript: comments, easy customization with ENV variables, no context switch (This is JavaScript).

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR: New Feature 🚀A type of pull request used for our changelog categoriesoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions