> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shardcloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# .shardignore File

> Control which files are excluded from deployment with the .shardignore file.

## What is .shardignore?

The `.shardignore` file controls which files and folders are excluded from deployment when using the ShardCloud VS Code extension. It works similarly to `.gitignore`.

<Info>
  Files matching patterns in `.shardignore` will not be uploaded to ShardCloud, reducing deployment size and time.
</Info>

***

## Creating .shardignore

Create a `.shardignore` file in your project root directory:

```bash theme={null}
# Dependencies
node_modules/
.pnpm-store/
vendor/

# Build outputs  
dist/
build/
out/
.next/

# Dev files
.git/
.vscode/
.idea/

# Logs and temp files
*.log
*.tmp
.DS_Store

# Environment files (optional - may want to include)
.env.local
.env.development
```

***

## Pattern Syntax

The `.shardignore` file supports standard glob patterns:

| Pattern      | Description                | Example          |
| ------------ | -------------------------- | ---------------- |
| `folder/`    | Ignore entire directory    | `node_modules/`  |
| `*.ext`      | Ignore files by extension  | `*.log`          |
| `filename`   | Ignore specific file       | `.DS_Store`      |
| `**/pattern` | Match in any directory     | `**/*.test.js`   |
| `!pattern`   | Negate (include) a pattern | `!important.log` |

***

## Common Examples

### Node.js Project

```bash theme={null}
node_modules/
.pnpm-store/
dist/
build/
.next/
coverage/
*.log
.env.local
```

### Python Project

```bash theme={null}
__pycache__/
*.pyc
.venv/
venv/
.pytest_cache/
*.egg-info/
dist/
build/
```

### General Development

```bash theme={null}
# Version control
.git/
.svn/

# IDEs
.vscode/
.idea/
*.swp
*.swo

# OS files
.DS_Store
Thumbs.db

# Test files
*.test.js
*.spec.js
__tests__/
```

***

## Best Practices

<CardGroup cols={2}>
  <Card title="Always Exclude Dependencies" icon="box">
    Dependencies are installed automatically on ShardCloud.
  </Card>

  <Card title="Exclude Build Outputs" icon="hammer">
    Build artifacts are regenerated during deployment.
  </Card>

  <Card title="Keep Config Files" icon="gear">
    Include `.shardcloud` and necessary config files.
  </Card>

  <Card title="Review Before Deploy" icon="eye">
    Check what's being uploaded in the extension output.
  </Card>
</CardGroup>

<Warning>
  Don't ignore your `.shardcloud` config file or essential source files needed for your application to run.
</Warning>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Files still being uploaded">
    Ensure the pattern is correct. Directory patterns should end with `/`.
    Check for typos in file/folder names.
  </Accordion>

  <Accordion title="Application fails after deploy">
    You may have ignored essential files. Review your `.shardignore` and ensure
    source files and configs are included.
  </Accordion>

  <Accordion title="Deployment is slow">
    Add more patterns to exclude large directories like `node_modules/`, build
    outputs, and test files.
  </Accordion>
</AccordionGroup>
