Skip to content

Commit

Permalink
feat(bob): add ignore pattern to config
Browse files Browse the repository at this point in the history
  • Loading branch information
atlj committed Aug 24, 2023
1 parent 6650bc1 commit 298780c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ In addition, the following options are supported:

- `sourceMaps` (`boolean`): Sourcemaps are generated by default alongside the compiled files. You can disable them by setting the `sourceMaps` option to `false`.

- `ignorePattern` (`string`): Glob pattern to be used while filtering the unnecessary files. Defaults to `'**/{__tests__,__fixtures__,__mocks__}/**'` if you don't specify it.

Example:

```json
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-builder-bob/src/targets/commonjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Options = Input & {
configFile?: string | false | null;
sourceMaps?: boolean;
copyFlow?: boolean;
ignorePattern?: string;
};
};

Expand Down
1 change: 1 addition & 0 deletions packages/react-native-builder-bob/src/targets/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Options = Input & {
configFile?: string | false | null;
sourceMaps?: boolean;
copyFlow?: boolean;
ignorePattern?: string;
};
};

Expand Down
4 changes: 3 additions & 1 deletion packages/react-native-builder-bob/src/utils/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Options = Input & {
configFile?: string | false | null;
sourceMaps?: boolean;
copyFlow?: boolean;
ignorePattern?: string;
modules: 'commonjs' | false;
field: 'main' | 'module';
};
Expand All @@ -21,6 +22,7 @@ export default async function compile({
output,
babelrc = false,
configFile = false,
ignorePattern = '**/{__tests__,__fixtures__,__mocks__}/**',
modules,
copyFlow,
sourceMaps = true,
Expand All @@ -31,7 +33,7 @@ export default async function compile({
cwd: source,
absolute: true,
nodir: true,
ignore: '**/{__tests__,__fixtures__,__mocks__}/**',
ignore: ignorePattern,
});

report.info(
Expand Down

0 comments on commit 298780c

Please sign in to comment.