How to use β frontend/index.ts β
Every plugin with a frontend folder loads frontend/index.ts (or the path from raclette.plugin.ts). Export your config with defineRaclettePluginFrontend.
If the file is missing, raclette may still build a minimal API from backend routes and generated-config.ts, but you lose install, hand-written data, i18n, and exportComponents.
Minimal export β
typescript
import { defineRaclettePluginFrontend } from "@raclettejs/core/frontend"
export default defineRaclettePluginFrontend({
install: async ($installApi, $corePluginApi) => {
// optional: run once at plugin load
},
i18n: {
"en-EU": { title: "Hello" },
},
})Full template with placeholders: Frontend plugin index β cooking step.
What each key does β
| Key | When you need it |
|---|---|
install | Register store effects, $eventbus listeners; return extra keys merged onto $api |
i18n | User-visible strings β see i18n |
data | Only if there is no generated-config.ts or you need extra operations β see Consuming generated-config |
exportComponents | Rare; see Exporting components |
Keep this file as wiring; put UI in widgets and shared Vue code in Vue structure.