Skip to content

[Question] How I can redefine getEnableBabelRCLookup prop for metro bundler? #20315

Closed
@DTupalov

Description

@DTupalov

Question
How I can redefine getEnableBabelRCLookup prop for metro bundler?

Why I need it
As I know, mertro bundler right now transpile all modules, including 3rd party libraries. But some of them already transpiled and has .babelrc config with presets and plugins, that no in dependencies. And when metro try to transpile such module, it throws error for unknown plugin, for example, lib @dump247/storybook-state:

error: bundling failed: ReferenceError: Unknown plugin "transform-react-remove-prop-types" specified in "C:\\GIT\\sandbox\\rn_0554\\node_modules\\@dump247\\storybook-state\\.babelrc" at 0, attempted to resolve relative to "C:\\GIT\\sandbox\\rn_0554\\node_modules\\@dump247\\storybook-state"

It is not good to install all missing plugins or presets, so I want to disable babelRCLookup.

What I've tried
I followed for Metro documentation.
Set metro.config.js in root of my project

export default {
    enableBabelRCLookup: () => false
}

but it didn't work.
BTW doc is very poor :(

Versions
OS: Win10
Node: v8.9.4
NPM: v6.2.0
React Native: v0.55.4
Metro: v0.30.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.Type: InvalidThis issue does not belong here. Applying this label will cause issue to be closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions