diff --git a/documentation/docs/14-configuration.md b/documentation/docs/14-configuration.md index d43c9bdf1063..43a45fd9a5f5 100644 --- a/documentation/docs/14-configuration.md +++ b/documentation/docs/14-configuration.md @@ -31,6 +31,7 @@ const config = { hydrate: true, package: { dir: 'package', + emitTypes: true, exports: { include: ['**'], exclude: ['_*', '**/_*'] @@ -38,8 +39,7 @@ const config = { files: { include: ['**'], exclude: [] - }, - emitTypes: true + } }, paths: { assets: '', @@ -85,10 +85,10 @@ The directory relative to `paths.assets` where the built JS and CSS (and importe An object containing zero or more of the following `string` values: - `assets` — a place to put static files that should have stable URLs and undergo no processing, such as `favicon.ico` or `manifest.json` +- `hooks` — the location of your hooks module (see [Hooks](#hooks)) - `lib` — your app's internal library, accessible throughout the codebase as `$lib` - `routes` — the files that define the structure of your app (see [Routing](#routing)) - `serviceWorker` — the location of your service worker's entry point (see [Service workers](#service-workers)) -- `hooks` — the location of your hooks module (see [Hooks](#hooks)) - `template` — the location of the template for HTML responses ### floc @@ -131,9 +131,9 @@ Whether to [hydrate](#ssr-and-javascript-hydrate) the server-rendered HTML with Options related to [creating a package](#packaging). - `dir` - output directory +- `emitTypes` - by default, `svelte-kit package` will automatically generate types for your package in the form of `d.ts.` files. While generating types is configurable, we believe it is best for the ecosystem quality to generate types, always. Please make sure you have a good reason when setting it to `false` (for example when you want to provide handwritten type definitions instead). - `exports` - contains a `includes` and a `excludes` array which specifies which files to mark as exported from the `exports` field of the `package.json` - `files` - contains a `includes` and a `excludes` array which specifies which files to process and copy over when packaging -- `emitTypes` - by default, `svelte-kit package` will automatically generate types for your package in the form of `d.ts.` files. While generating types is configurable, we believe it is best for the ecosystem quality to generate types, always. Please make sure you have a good reason when setting it to `false` (for example when you want to provide handwritten type definitions instead). ### paths diff --git a/packages/kit/types/config.d.ts b/packages/kit/types/config.d.ts index 49323c93e370..45482dddb12f 100644 --- a/packages/kit/types/config.d.ts +++ b/packages/kit/types/config.d.ts @@ -46,6 +46,7 @@ export type Config = { hydrate?: boolean; package?: { dir?: string; + emitTypes?: boolean; exports?: { include?: string[]; exclude?: string[]; @@ -54,11 +55,10 @@ export type Config = { include?: string[]; exclude?: string[]; }; - emitTypes?: boolean; }; paths?: { - base?: string; assets?: string; + base?: string; }; prerender?: { crawl?: boolean; @@ -100,6 +100,7 @@ export type ValidatedConfig = { hydrate: boolean; package: { dir: string; + emitTypes: boolean; exports: { include: string[]; exclude: string[]; @@ -108,11 +109,10 @@ export type ValidatedConfig = { include: string[]; exclude: string[]; }; - emitTypes: boolean; }; paths: { - base: string; assets: string; + base: string; }; prerender: { crawl: boolean;