Skip to content

Conversation

@atlj
Copy link
Collaborator

@atlj atlj commented Aug 24, 2023

Summary

This adds the possibility to pass custom ignore patterns while working with builder bob.

Test plan

  1. Create a new library using create-react-native-library. You can select Native module, and Kotlin & Swift options.
  2. Go to package.json, and find the react-native-builder-bob section
  3. Replace commonjs target as following:
{
    "exclude": "**/ignore_me/**"
    "targets": [
      "commonjs",
      "module",
      [
        "typescript",
        {
          "project": "tsconfig.build.json"
        }
      ]
    ]
}
  1. Create a new folder named src/ignore_me and put .ts files inside it
  2. Build the library and make sure the files inside the ignore_me aren't included in the commonjs and module targets.

@atlj atlj force-pushed the @atlj/bob-config-ignore-field branch from 3aec318 to 298780c Compare August 24, 2023 14:07
@atlj atlj changed the title @atlj/bob config ignore field feat(bob): add ignore pattern to config Aug 24, 2023

const root = process.cwd();
const explorer = cosmiconfigSync(name, {
searchPlaces: ['package.json', `bob.config.js`, 'bob.config.cjs'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are use the pattern of passing top-level options in the argument object (like source, output) and target specific options in the options field. So lets do the same for exclude.

@satya164 satya164 merged commit ef37512 into main Sep 15, 2023
@satya164 satya164 deleted the @atlj/bob-config-ignore-field branch September 15, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants