Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DTupalov opened this issue Jul 20, 2018 · 0 comments
Closed
Labels
Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot. Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed.

Comments

@DTupalov
Copy link

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

@kelset kelset added Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed. labels Jul 20, 2018
@kelset kelset closed this as completed Jul 20, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot. Type: Invalid This issue does not belong here. Applying this label will cause issue to be closed.
Projects
None yet
Development

No branches or pull requests

3 participants