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

Smarter detection of imported dependency files #288

Merged
merged 11 commits into from
Jul 2, 2024
Merged

Conversation

magne4000
Copy link
Member

@magne4000 magne4000 commented Jul 2, 2024

Closes #275

Added a new syntax to exclude a file from being generated:

/*# BATI include-if-imported #*/

// If a file starts with the above comment, it will only be generated if it's at least imported
// by one other generated file
...

NB: This can be used in boilerplates using package.json#bati.if (but package.json#bati.if rules will still apply).

Example

In the following example, file-a.ts is only generated if file-b.ts is also present.

boilerplates/something/files/file-a.ts
/*# BATI include-if-imported #*/

export const a = 1;
boilerplates/something-else/files/file-b.ts
import * from '@batijs/something/file-a';

...

Copy link

github-actions bot commented Jul 2, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://batijs.dev/pr-preview/pr-288/
on branch gh-pages at 2024-07-02 13:57 UTC

@magne4000 magne4000 merged commit 5b023f7 into main Jul 2, 2024
9 checks passed
@magne4000 magne4000 deleted the parser-global-tags branch July 2, 2024 15:36
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.

Smarter detection of imported dependency files
1 participant