# Frontend Sync and Build Workflow

This project uses `frontDev` as the frontend source workspace and `frontend` as the deployed static output served by the backend.

## Folder roles

- `frontDev/`: Vue source code copied from `routebox`
- `frontend/`: compiled build artifacts served by Express

## Commands (run from `pp_test_backend`)

### 1) Sync frontend source from routebox

```bash
npm run sync:frontdev
```

What it does:

- Copies files from `f:\git_ops\routebox` into `pp_test_backend/frontDev`
- Skips `.git`, `node_modules`, and `dist`
- Removes stale files from `frontDev` that no longer exist in `routebox`
- Preserves local `frontDev/vue.config.js` so build output stays configured for backend deployment

### 2) Build frontend into backend deployment folder

```bash
npm run build:frontend
```

What it does:

- Runs Vue production build inside `frontDev`
- Outputs compiled assets directly to `pp_test_backend/frontend`

Expected successful build message includes:

- `Build complete. The ..\frontend directory is ready to be deployed.`

## Typical update flow

```bash
npm run sync:frontdev
npm run build:frontend
```

## Optional: refresh Browserslist data

```bash
npm run update:browserslist
```

Note:

- You may still see a non-blocking Browserslist age warning during build in some environments.
