Saltar al contenido principal
ProductosHerramientas de escritorioTASTECADRevisión de planosTASTEFILESGestión de archivosTASTEFTPTransferencia de archivosTASTESSHEspacio de trabajo remotoTASTEZIPCompresión y extracciónTASTEWINMGestión de archivosHerramientas para desarrolladoresTASTECODEEntorno de desarrollo integrado para RustTASTESTUDIOEntorno integrado de desarrollo y pruebasTASTEETLIntegración de datos (ETL)ServidoresTASTEREMOTEServidor de escritorio remotoTASTEGEOServidor geoespacialTASTEMAILEspacio de trabajo de correoInversiónTASTESTOCKAplicación de escritorio de trading automático de accionesEmpezarDescargasDocumentaciónComprarTodos los productos
Marketplace
Noticias
TecnologíaNoticiasNoticias de desarrollo de hoyDocumentaciónLenguajes de programaciónRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFrameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngularFrameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFrameworks de apps y escritorioTauriFlutterReact NativeElectronAlgoritmosFundamentos de algoritmosAlgoritmos esencialesAlgoritmos avanzadosAlgoritmos prácticos
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparateGuía de la comunidad
ColaboraTransferencia técnicaDesarrollo de sitio webDesarrollo de app de escritorioCanal de lanzamiento y pagosSocio de ventasContacto
ServiciosEscritorio remotoPaquetes de instalación a medida
TASTEDEV
Productos

Herramientas de escritorio

TASTECADAbre planos complejos con ligerezaTASTEFILESSolo los archivos que necesitas, lo más rápido posibleTASTEFTPEl camino más limpio para tus archivosTASTESSHEntre tu servidor y tú, una conexión más sólidaTASTEZIPComprime más rápido, descomprime más seguroTASTEWINMUn gestor de archivos de dos paneles pensado para el teclado

Herramientas para desarrolladores

TASTECODEEdita, compila, depura y prueba apps de Rust en una sola ventanaTASTESTUDIODe la edición a las pruebas remotas y las correcciones con IA aprobadasTASTEETLMueve datos viendo sus valores

Servidores

TASTEREMOTEUn escritorio remoto que funciona en tu propio servidorTASTEGEOUn servidor geoespacial compatible con GeoServer, reconstruido en RustTASTEMAILRecupera el control de tu correo

Inversión

TASTESTOCKTrading automático de acciones según las reglas que tú defines: cuándo y qué

Empezar

DescargasÚltimas versiones de cada productoDocsCómo usar cada productoComprarSuscripciones y licencias perpetuasTodos los productosTodos los productos de un vistazo
Todos los productos
MarketplaceNoticias
Tecnología

Noticias

Noticias de desarrollo de hoyAnuncios oficiales de lenguajes, frameworks, GitHub e IADocumentaciónGuías de lenguajes, frameworks y algoritmos

Lenguajes de programación

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Frameworks web frontendNext.jsReactVue.js · NuxtSvelteKitAngular
Frameworks de servidorSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Frameworks de apps y escritorioTauriFlutterReact NativeElectron

Algoritmos

Fundamentos de algoritmosAnálisis de complejidad · Ordenamiento · Búsqueda · Estructuras de datos básicas · Árboles y montículosAlgoritmos esencialesRecorrido de grafos · Camino mínimo y árbol generador mínimo · Programación dinámica · Algoritmos voraces · Divide y vencerás · Backtracking (vuelta atrás)Algoritmos avanzadosAlgoritmos de cadenas · Matemáticas y teoría de números · Manipulación de bits · Árboles de segmentos · Union-FindAlgoritmos prácticosEstrategia para entrevistas de código · Caché LRU · Limitación de tasa · Hashing consistente
Toda la documentación de desarrollo
Comunidad
ProyectosDescubre creadores y su trabajoRegistros de desarrolloDecisiones y aprendizajesPromptsInstrucciones reutilizablesProblemas con herramientas de IAProblemas y alternativas de Claude, Codex, GeminiEscaparateResultados terminadosGuía de la comunidadCómo construimos en abierto
Colabora
Transferencia técnicaApps nativas con Rust y eguiDesarrollo de sitio web10 idiomas, cuentas, documentación y descargasDesarrollo de app de escritorioRust y egui, sin WebViewCanal de lanzamiento y pagosFirma, MSI, deb, rpm, AppImage, hashesSocio de ventasRecomiéndanos y gana el 30 %ContactoDesarrollo, alianzas e inversión
Servicios
Escritorio remotoAccede a tu ordenador desde el navegadorPaquetes de instalación a medidaSolo lo necesario, ajustes precargados
Comprar
ES
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Iniciar sesión
Iniciar sesión
TASTEDEV

De pequeñas herramientas a un mejor desarrollo.

support@tastedev.netApoyar a TASTEDEV
ProductosLínea de productosComprarDocsDescargasMarketplaceSoporte
ComunidadProyectosRegistros de desarrolloPromptsProblemas con herramientas de IAEscaparate
PolíticasQuiénes somosPolítica de privacidadTérminos de servicioCondiciones de suscripciónReembolsosNormas de la comunidad
CuentaIniciar sesiónRegistrarse
Visitantes
Hoy
Ayer
Vistas totales
Empresa
GXSOFT
Representante
CHOI YOUNG GU
Número de registro mercantil
853-44-00368
Dirección
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Teléfono
+82-10-4404-1523
Correo electrónico
whitecalvin@tastedev.net
Responsable de privacidad
CHOI YOUNG GU

© 2026 TASTEDEVLa información de los productos se basa en fuentes de desarrollo verificadas.Publicado · en mejora

Documentación de SvelteKit
SvelteKit
Getting Started with SvelteKitProject StructureCore ConceptsData and StateTestingBuilding and Deployment
Debates

Guía de SvelteKit · 2/6

Project Structure

Por ahora, este capítulo solo está disponible en inglés.

SvelteKit relies on conventions: folder and file names decide how your app behaves. This chapter walks through the layout of a new project, its configuration files and the naming rules for routes.

The default layout

A TypeScript project created with sv create looks roughly like this:

my-app/
  src/
    lib/                 # shared code and components
      server/            # server-only code
    routes/              # pages and endpoints (URL = folder structure)
      +layout.svelte
      +page.svelte
    app.html             # HTML template
    app.d.ts             # app-wide types (App.Locals and friends)
    hooks.server.ts      # server hooks (optional)
    hooks.client.ts      # client hooks (optional)
    params.ts            # route parameter matchers (optional)
  static/                # files served as-is (robots.txt, favicon)
  tests/                 # Playwright tests, if you added them
  package.json
  tsconfig.json
  vite.config.ts

Only src/routes and src/app.html are required; everything else is optional. The .svelte-kit/ folder is generated by the dev server and the build. You can delete it at any time, and it should not be committed.

Configuration lives in vite.config.ts

SvelteKit options are passed to the sveltekit() plugin in vite.config.ts. Older releases used a separate svelte.config.js, which the current release no longer supports, so keep that in mind when reading older tutorials. Adapters, paths, CSRF settings and other SvelteKit options all go here.

import adapter from '@sveltejs/adapter-auto';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    sveltekit({
      adapter: adapter()
    })
  ]
});

Regular Vite settings, such as the server port, proxies or extra plugins, go into the same defineConfig call.

The #lib alias and package.json

Code in src/lib is imported through the #lib alias. It is a Node.js subpath import, so it is declared in the imports field of package.json, and imports include the file extension.

{
  "type": "module",
  "imports": {
    "#lib": "./src/lib/index.js",
    "#lib/*": "./src/lib/*"
  }
}
import { formatDate } from '#lib/date.js';
import Button from '#lib/components/Button.svelte';

When you come across examples using the older $lib alias, read them as #lib plus an explicit extension. tsconfig.json extends the configuration SvelteKit generates, and your project decides which files to include.

¿Tienes preguntas sobre este capítulo?
Capítulo anteriorGetting Started with SvelteKitCapítulo siguienteCore Concepts

Route file conventions

Each folder inside src/routes becomes a URL segment, and files starting with + define what that route does.

FilePurpose
+page.svelteThe page UI
+page.tsPage data loading (runs on the server and in the browser)
+page.server.tsServer-only data loading and form actions
+layout.svelteA shared shell around child pages
+layout.ts, +layout.server.tsLayout data
+server.tsAn API endpoint (GET, POST and so on)
+error.svelteThe error page

Folder names follow conventions too. [slug] is a dynamic parameter, [[lang]] is an optional parameter, [...rest] matches the rest of the path, and a folder in parentheses such as (group) does not appear in the URL; it only groups routes under a shared layout.

src/routes/
  (marketing)/
    +layout.svelte       # shared shell for marketing pages
    pricing/+page.svelte # /pricing
  blog/
    +page.svelte         # /blog
    [slug]/
      +page.svelte       # /blog/hello-world
      +page.server.ts
  api/
    search/+server.ts    # /api/search

Param matchers and hooks

To validate route parameters, define matchers in a single src/params.ts file. A matcher returns the value when it is acceptable and undefined otherwise.

import { defineParams } from '@sveltejs/kit/params';

export const params = defineParams({
  fruit: (param) => (param === 'apple' || param === 'orange' ? param : undefined)
});

With this in place, src/routes/fruits/[name=fruit]/+page.svelte matches only apple and orange. Code that should run around every request belongs in the handle function of src/hooks.server.ts; later chapters show how to put per-request values, such as the signed-in user, on event.locals.

Summary

  • Pages and endpoints live in src/routes, shared code in src/lib, and static files in static.
  • SvelteKit is configured through the sveltekit() plugin options in vite.config.ts.
  • Import from src/lib with the #lib alias and an explicit file extension.
  • The +page, +layout, +server and +error files, together with [param] and (group) folders, define your routing.

0 comentarios

Comentarios destacadosMás recientes primero

Iniciar sesión · Inicia sesión para dejar un comentario.