Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneTASTEWINMGestione fileStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailInvestimentiTASTESTOCKApp desktop di trading automatico azionarioIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuroTASTEWINMUn file manager a due pannelli pensato per la tastiera

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Investimenti

TASTESTOCKTrading automatico azionario secondo le regole che decidi tu: quando e che cosa

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeChi siamoInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
Ieri
Visualizzazioni totali
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di SvelteKit
SvelteKit
Getting Started with SvelteKitProject StructureCore ConceptsData and StateTestingBuilding and Deployment
Discussioni

Guida a SvelteKit · 2/6

Project Structure

Per ora questo capitolo è disponibile solo in inglese.

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.

Domande su questo capitolo?
Capitolo precedenteGetting Started with SvelteKitCapitolo successivoCore 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 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.