histoire.config.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. import { defineConfig } from 'histoire'
  3. import { HstVue } from '@histoire/plugin-vue'
  4. export default defineConfig({
  5. setupFile: './app/frontend/stories/support/setupHistoire.ts',
  6. storyMatch: ['app/frontend/**/*.story.vue'],
  7. plugins: [HstVue()],
  8. viteNodeInlineDeps: [/@vue\/apollo-composable/],
  9. vite: {
  10. plugins: [
  11. {
  12. name: 'inject-fonts',
  13. transformIndexHtml() {
  14. return [
  15. { tag: 'link', attrs: { rel: 'stylesheet', href: '/assets/mobile/fonts.css' } },
  16. ]
  17. },
  18. },
  19. ],
  20. server: {
  21. port: 3074,
  22. ...(process.env.HISTOIRE_BUILD && {
  23. hmr: false,
  24. watch: { ignored: ['**/*'] },
  25. }),
  26. open: true,
  27. },
  28. logLevel: process.env.HISTOIRE_BUILD ? 'error' : 'info',
  29. },
  30. tree: {
  31. groups: [
  32. {
  33. id: 'common',
  34. title: 'Common',
  35. include: (file) => file.title.startsWith('Common'),
  36. },
  37. {
  38. id: 'modules',
  39. title: 'Modules',
  40. },
  41. {
  42. id: 'form',
  43. title: 'Form',
  44. include: (file) => file.title.startsWith('Field'),
  45. },
  46. ],
  47. },
  48. })