D
D
Dmitry2019-05-11 09:22:04
React
Dmitry, 2019-05-11 09:22:04

How to add plugin to babel in React project?

I get an error when running tests

SyntaxError: C:\OSPanel\domains\localhost\maxiru\table-res-test\table-reservation\src\scripts\uti
ls\lodash.js: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (1: 8):
> 1 | export each from 'lodash/each'

and message
Add @babel/plugin-proposal-export-default-from ( https://git.io/vb4yH) to the 'plugins' section of
your Babel config to enable transformation.

But the .babelrc file contains this plugin
"presets": [
        "@babel/preset-env",
        "@babel/preset-react"
    ],
    "plugins": [
        "@babel/plugin-transform-runtime",
        "@babel/plugin-proposal-export-default-from"

Where else can/should I add a plugin for the linker to see it?
Thanks in advance for your replies

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Ostic, 2019-05-11
@Ostic

What are you trying to do and how?
if you want to import lodash functions you may need to install lodash-es
import { find } from 'lodash-es';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question