-
Notifications
You must be signed in to change notification settings - Fork 1
Environment & Configuration Files
This document outlines the key environment and configuration files in the project, explaining their purpose and specific configurations for different scenarios.
Environment files store sensitive information and configurable settings for different environments (development, staging, production).
📜 .env.example # Example environment variables document
📜 .env.development # Development-specific settings
📜 .env.production # Production-specific settings
VITE_MAPTILER_API_KEY="your_maptiler_api_key"
VITE_GEOSERVER_BASE_URL="$VITE_GEOSERVER_ROOT_URL/geoserver"
VITE_BACKEND_ROOT_URL="http://your-backend-root-url" const url = new URL(
`${import.meta.env.VITE_GEOSERVER_BASE_URL}/${workspace}/wms?service=WMS&version=1.1.0&request=GetMap&layers=${workspace}:${layer}&bbox=${bbox ?? ""}&width=512&height=512&srs=EPSG:4326&format=geojson&CQL_FILTER=${cqlFilter ?? ""}&styles=`
);```
---
## **2. TypeScript Configuration (`tsconfig.json` & `tsconfig.node.json`)**
### **Key Settings in `tsconfig.json`**【123†source】:
```json
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable", "ES2021.String"],
"strict": true,
"paths": {
"@components/*": ["./src/components/*"],
"@store/*": ["./src/store/*"],
"@helpers/*": ["./src/core/helpers/*"]
}
}
}{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler"
},
"include": ["vite.config.ts"]
}Notable Configurations:
-
moduleResolution: bundler– Optimized for Vite and modern JavaScript workflows. -
pathsaliasing – Helps in cleaner imports, e.g.,@components/Button.vue. -
strict: true– Ensures strong TypeScript type checking.
Vite handles the build and development server configuration.
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [vue()],
server: {
port: 5173,
},
resolve: {
alias: {
'@': '/src'
}
}
});Notable Configurations:
-
Module aliasing (
@/forsrc/) - Default dev server port: 5173
Handles CSS processing and optimizations.
export default {
plugins: {
'postcss-import': {},
'tailwindcss/nesting': {},
tailwindcss: {},
autoprefixer: {},
}
}Notable Configurations:
-
CSS Nesting enabled via
tailwindcss/nesting - Auto-prefixing for browser compatibility
Handles TailwindCSS customizations.
export default {
darkMode: "selector",
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
theme: {
extend: {
colors: {
primary: "rgb(var(--primary))",
blue: {
500: "#0C06BF"
}
}
}
}
};Notable Configurations:
-
Extended
bluecolor palette based on#0C06BF -
Custom
darkMode: selectorfor advanced dark mode handling
Defines dependencies, scripts, and build process.
{
"scripts": {
"dev": "vite --mode development",
"test": "vitest",
"build": "vue-tsc && vite build --mode production",
"preview": "vite preview"
}
}Notable Configurations:
buildruns TypeScript checks (vue-tsc) before production build.-
Testing framework: Uses
Vitestfor unit tests.
Manages linting rules for TypeScript and Vue【122†source】.
Notable Configurations:
- Uses
eslint-plugin-vuefor Vue-specific linting. - Uses
@typescript-eslintfor TypeScript static analysis.
-
Do not commit
.envfiles to version control (use.env.examplefor reference). -
Use module aliases (
@components,@store) to avoid long import paths. - Keep configurations modular and extend only necessary settings.
- Document changes when modifying configs to avoid breaking builds.
For further details, refer to the official documentation of Vite, TypeScript, PostCSS, TailwindCSS, and ESLint.
Welcome to the TOSCA Wiki! You'll find both user and developer documentation here.