Skip to content

Entry

The DreamKit entry allows you to configure your application by simply exporting objects created with the following constructors:

The default entry path is src/dreamkit.tsx and can be configured by dreamkitPlugin.

It is not mandatory to create the routes and APIs in the entry, you can still use the file system (src/routes/*), since both systems can work at the same time.

However, the rest of the objects do need to be exported from the entry (settings, middlewares, services and sessions).

The entry has an advanced tree shaking system that separates each route with its dependencies and is compatible with HMR.

All examples shown in the documentation make use of this mechanic to more easily illustrate the code. And remember, the entry is optional for routes and APIs and you can use the file system also.

The following examples are equivalent:

/src/dreamkit.tsx
import { $route } from "dreamkit";
export default $route.path("/").create(() => {
return <>Hello World</>;
});