feat: update environment setup and script commands for consistency

This commit is contained in:
waseem khadri
2026-07-09 11:37:57 +05:30
parent 447f0b567f
commit 5cbf6baa3a
2 changed files with 40 additions and 47 deletions
+34 -38
View File
@@ -23,42 +23,33 @@ This project supports multiple environment configurations for local development,
## Running the Application ## Running the Application
### Development Servers (Local) ### Development Servers
- **Dev Environment (Port 9501):**
```bash
npm run dev
```
- **Test Environment (Port 9502):**
```bash
npm run test
```
- **UAT Environment (Port 5176):**
```bash
npm run uat
```
- **Local Development (Port 5174):** - **Local Development (Port 5174):**
```bash ```bash
npm run dev:local npm run dev:local
``` ```
or simply:
```bash
npm run dev
```
- **Dev Environment (Port 5174):**
```bash
npm run dev:dev
```
- **Test Environment (Port 5175):**
```bash
npm run dev:test
```
- **UAT Environment (Port 5176):**
```bash
npm run dev:uat
```
### Building for Production ### Building for Production
- **Build for Local:**
```bash
npm run build:local
```
- **Build for Dev:** - **Build for Dev:**
```bash ```bash
npm run build:dev npm run build
``` ```
- **Build for Test:** - **Build for Test:**
@@ -71,16 +62,16 @@ This project supports multiple environment configurations for local development,
npm run build:uat npm run build:uat
``` ```
### Preview Production Build - **Build for Local:**
- **Preview Local Build:**
```bash ```bash
npm run preview:local npm run build:local
``` ```
### Preview Production Build
- **Preview Dev Build:** - **Preview Dev Build:**
```bash ```bash
npm run preview:dev npm run preview
``` ```
- **Preview Test Build:** - **Preview Test Build:**
@@ -93,6 +84,11 @@ This project supports multiple environment configurations for local development,
npm run preview:uat npm run preview:uat
``` ```
- **Preview Local Build:**
```bash
npm run preview:local
```
## Environment Variables ## Environment Variables
Each environment file contains these variables: Each environment file contains these variables:
@@ -120,14 +116,14 @@ const baseURL = import.meta.env.VITE_API_URL
## Development Ports ## Development Ports
Each environment runs on a different port to allow running multiple instances: Each environment runs on a different port:
| Environment | Port | | Environment | Port | Command |
|------------|-------| |------------|-------|---------------|
| Local | 5174 | | Dev | 9501 | `npm run dev` |
| Dev | 5174 | | Test | 9502 | `npm run test`|
| Test | 5175 | | UAT | 5176 | `npm run uat` |
| UAT | 5176 | | Local | 5174 | `npm run dev:local` |
## Notes ## Notes
+6 -9
View File
@@ -4,20 +4,17 @@
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite --mode dev",
"dev:local": "vite --mode local", "local": "vite --mode local",
"dev:dev": "vite --mode dev", "test": "vite --mode test",
"dev:test": "vite --mode test", "uat": "vite --mode uat",
"dev:uat": "vite --mode uat", "build": "tsc -b && vite build --mode dev",
"build": "tsc -b && vite build",
"build:local": "tsc -b && vite build --mode local", "build:local": "tsc -b && vite build --mode local",
"build:dev": "tsc -b && vite build --mode dev",
"build:test": "tsc -b && vite build --mode test", "build:test": "tsc -b && vite build --mode test",
"build:uat": "tsc -b && vite build --mode uat", "build:uat": "tsc -b && vite build --mode uat",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview", "preview": "vite preview --mode dev",
"preview:local": "vite preview --mode local", "preview:local": "vite preview --mode local",
"preview:dev": "vite preview --mode dev",
"preview:test": "vite preview --mode test", "preview:test": "vite preview --mode test",
"preview:uat": "vite preview --mode uat" "preview:uat": "vite preview --mode uat"
}, },