Portfolio Moderno uses Vite 6 to compile TypeScript and bundle all assets for production. Running the build command produces a fully static site in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nicolasgrajaleshoyos/portafolio/llms.txt
Use this file to discover all available pages before exploring further.
dist/ directory — no server-side rendering required — so the output can be served by any static hosting provider without additional configuration.
Running the Build
Install dependencies
Make sure all project dependencies are installed before building. Use whichever package manager you prefer:
Run the build command
Execute the
build script defined in package.json. Vite reads vite.config.ts, resolves all imports, and bundles the application:Understand what happens during the build
Vite processes the project in two stages. First, it resolves TypeScript through its internal
esbuild pipeline (using the compiler options in tsconfig.json as a reference). Then it bundles, tree-shakes, and minifies all JavaScript and CSS assets into the dist/ directory. Static files in the public/ folder are copied into dist/ as-is, without hashing.Build Output
After a successful build thedist/ directory contains everything needed to serve the site:
index-3a8f2c1b.js). This makes long-term browser caching safe — when source code changes, the hash changes and the browser fetches the updated file automatically. Files copied from public/ (such as icons/) are transferred verbatim with their original names and no hashing applied.
TypeScript Configuration
Thetsconfig.json at the project root configures the TypeScript compiler for this project. The settings most relevant to the production build are:
| Option | Value | Effect |
|---|---|---|
target | ES2022 | Outputs modern JavaScript that matches the capabilities of current evergreen browsers. |
moduleResolution | bundler | Uses Vite-aware module resolution, allowing bare specifier imports the same way Vite resolves them at build time. |
isolatedModules | true | Ensures each file can be transpiled independently, which is required for Vite’s fast esbuild-based transform. |
noEmit | true | TypeScript performs type-checking only; Vite’s esbuild pipeline handles the actual transpilation. |
allowJs | true | Allows JavaScript files (such as postcss.config.js) to be included in the project without errors. |
strict: true. Options such as experimentalDecorators and useDefineForClassFields are configured independently where needed.
Environment Variables
vite.config.ts uses Vite’s loadEnv helper to read variables from a .env file at build time. The GEMINI_API_KEY variable is injected into the bundle under two names so that different parts of the codebase can reference it consistently:
vite.config.ts
.env file in the project root and add your key before running the build:
.env
.env.local is listed in .gitignore (matched by the *.local pattern), and the dist/ directory is also excluded from version control. Never commit API keys or any file containing secrets to source control. Use .env.local for local secrets — it is ignored by Git automatically — and configure the key as an environment variable or secret in your hosting platform’s dashboard for production deployments.