Skip to content

Add metro.config.js to tsconfig excluded files #29

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

Merged
merged 1 commit into from
Mar 7, 2019

Conversation

tallpants
Copy link

In the latest RC of React Native (0.59.0-rc.3) a metro.config.js file is created with the following content:

/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
};

When you run tsc, it fails with this error:

metro.config.js:8:1 - error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.

8 module.exports = {
  ~~~~~~


Found 1 error.

This PR fixes that error by excluding the metro.config.js file just like we did for babel.config.js.

In the latest RC of React Native (0.59.0-rc.3) a `metro.config.js` file is created with the following content:

```js
/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @Format
 */

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
};
```

When you run `tsc`, it fails with this error:

```
metro.config.js:8:1 - error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.

8 module.exports = {
  ~~~~~~


Found 1 error.
```

This PR fixes that error by excluding the `metro.config.js` file just like we did for `babel.config.js`.
@emin93 emin93 self-assigned this Mar 7, 2019
@emin93 emin93 added the bug Something isn't working label Mar 7, 2019
@emin93
Copy link
Member

emin93 commented Mar 7, 2019

Hi @tallpants,

Nice catch! There are actually more changes incoming for RN 0.59, I created a branch if you want to check it out.

@emin93 emin93 merged commit 2c6b757 into react-native-community:master Mar 7, 2019
emin93 added a commit that referenced this pull request Mar 7, 2019
Merge pull request #29 from tallpants/patch-1
@tallpants tallpants deleted the patch-1 branch March 7, 2019 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants