Gracile/Vite configuration
API references extracted from the Gracile code base.
Examples, functions, classes, constants, type declarations…
Interface: GracileConfig
Defined in: packages/engine/dist/user-config.d.ts:32
Example
/vite.config.js
import { gracileimport gracile } from '@gracile/gracile/plugin';
import { defineConfigfunction defineConfig(config: UserConfig): UserConfig (+5 overloads)Type helper to make it easier to use vite.config.ts
accepts a direct
{@link
UserConfig
}
object, or a function that returns it.
The function receives a
{@link
ConfigEnv
}
object.
} from 'vite';
export default defineConfigfunction defineConfig(config: UserConfig): UserConfig (+5 overloads)Type helper to make it easier to use vite.config.ts
accepts a direct
{@link
UserConfig
}
object, or a function that returns it.
The function receives a
{@link
ConfigEnv
}
object.
({
pluginsUserConfig.plugins?: PluginOption[] | undefinedArray of vite plugins to use.
: [
gracileimport gracile ({
outputoutput: string : 'server',
devdev: {
locals: (_context: any) => {
requestId: `${string}-${string}-${string}-${string}-${string}`;
userEmail: string;
};
}
: {
localslocals: (_context: any) => {
requestId: `${string}-${string}-${string}-${string}-${string}`;
userEmail: string;
}
: (_context_context: any ) => {
return {
requestIdrequestId: `${string}-${string}-${string}-${string}-${string}` : cryptovar crypto: Crypto .randomUUIDCrypto.randomUUID(): `${string}-${string}-${string}-${string}-${string}`The randomUUID() method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator.
Available only in secure contexts.
(),
userEmailuserEmail: string : 'admin@admin.home.arpa',
};
},
},
routesroutes: {
exclude: string[];
}
: {
excludeexclude: string[] : ['**/a-defective-route.ts'],
},
}),
],
});
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
|
|
|
Settings for the development mode. |
packages/engine/dist/user-config.d.ts:57 |
|
|
|
( |
|
Get incoming request context and apply locals for the Gracile request handler. Useful for mocking the production server. For |
packages/engine/dist/user-config.d.ts:64 |
|
|
|
Future, unstable features flags. |
packages/engine/dist/user-config.d.ts:147 |
|
|
|
|
|
Automatically typed route paths. |
packages/engine/dist/user-config.d.ts:152 |
|
|
|
‐ |
packages/engine/dist/user-config.d.ts:110 |
|
|
|
|
|
Lets you extend Gracile’s SSR pipeline with
custom Lit SSR In most cases, you do not set this option manually — add-on plugins
(like
|
packages/engine/dist/user-config.d.ts:142 |
|
|
|
The target output for the build phase. See the documentation. |
packages/engine/dist/user-config.d.ts:40 |
|
|
|
|
Settings for pages in |
packages/engine/dist/user-config.d.ts:80 |
|
|
|
|
|
Premises are the document and the properties necessary for page template rendering. You can access them via:
They are accessible with the dev/server handler and are outputted as static files for the static output or for server pre-rendered pages. They can be use for implementing client-side routing. |
packages/engine/dist/user-config.d.ts:95 |
|
|
|
|
Exclude routes with a glob filter array. |
packages/engine/dist/user-config.d.ts:107 |
|
|
|
|
‐ |
packages/engine/dist/user-config.d.ts:99 |
|
|
|
|
Include routes with a glob filter array. |
packages/engine/dist/user-config.d.ts:103 |
|
|
|
Settings for routes in |
packages/engine/dist/user-config.d.ts:71 |
|
|
|
|
|
Exclude routes with an array of patterns. Useful for debugging. |
packages/engine/dist/user-config.d.ts:75 |
|
|
|
Controls how trailing slashes are matched on incoming URLs.
|
packages/engine/dist/user-config.d.ts:53 |