Skip to content

docs: ignorepaths docs #7434

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions docs/content/guides/7.multistore/2.tooling-and-concepts/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,56 @@ The first matching file found is used. This allows stores to:
This resolution process applies to all file types: components, styles, configurations, etc. Understanding this helps you organize your overrides effectively.
:::

#### Ignoring files

You can ignore files from the build process by adding them to the `ignorePaths` property in the store's configuration file.

The rules are evaluated the same way as the one used in the .gitignore files. Ignore rules of a store merge with the ignore rules of its parents, where the ignore rules of the parent store are applied first.

That means that if you have inheritance hierarchy like this:

```bash
apps/
├── storefront-unified-nextjs/
└── stores/
├── fashion/
└── sports-brand/
├── storefront-unified-nextjs/
└── stores/
├── us-store/
└── eu-store/
```
Where the base brand comes with `app/[locale]/my-account.tsx` page but you don't want to have it in the `us-store` and `sports-brand` stores but while still keeping it in `eu-store`. Then you can modify your `alokai.config.json` to ignore it in the `us-store` and `sports-brand` stores but not in `eu-store`:

```diff
{
"stores": {
...
"sports-brand": {
...
+ "ignorePaths": [ "app/[locale]/my-account.tsx" ]
},
"eu-store": {
+ "ignorePaths": [ "!app/[locale]/my-account.tsx" ]
}
}
}
```

The result will be that the ignore rules of `us-store` and `sports-brand` will be look as follows:

```bash
app/[locale]/my-account.tsx
```

while the ignore rules of `eu-store` will be look as follows:

```bash
app/[locale]/my-account.tsx # inherits the rule from the sports-brand store
!app/[locale]/my-account.tsx # but we ignore it here
```


## Technical Implementation

### TypeScript Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ For deployable stores, the CLI adds a new entry with default settings. All of th
"nextjs": 3001, // Port for Next.js development
"nuxt": 3334 // Port for Nuxt development
},
"localDomain": "my-brand-us.local" // Domain for local development, when using `with-local-domains` flag
"localDomain": "my-brand-us.local", // Domain for local development, when using `with-local-domains` flag,
"ignorePaths": ["my-brand-us.json"] // Files to ignore when building the store
}
}
}
Expand Down
Loading