Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

How to better add individual babel plugins? #24

@bahmutov

Description

@bahmutov

I am trying to transpile spec that has

it('transpiles Object.fromEntries', () => {
  // https://github.com/tc39/proposal-object-from-entries
  const obj = Object.fromEntries([['a', 0], ['b', 1]])
})

I am trying to modify babel preset-env options via preprocessor to add useBuiltIns https://babeljs.io/docs/en/next/babel-preset-env#usebuiltins but nothing seems to work. I think a few more examples of adding support for specific babel transforms would be nice.

In general, I think a good question to answer in our docs would be:

Should users push Babel plugins into default options?
Or should they add them to .babelrc file and enable babelrc options?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions