Skip to content

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 ​

KeyWhen you need it
installRegister store effects, $eventbus listeners; return extra keys merged onto $api
i18nUser-visible strings β€” see i18n
dataOnly if there is no generated-config.ts or you need extra operations β€” see Consuming generated-config
exportComponentsRare; see Exporting components

Keep this file as wiring; put UI in widgets and shared Vue code in Vue structure.

See also ​