@@ -2,53 +2,57 @@ import type { StorybookConfig } from "@storybook/vue3-vite";
22import type { Plugin } from "vite" ;
33
44function jetpackTwigPlugin ( ) : Plugin {
5- return {
6- name : "frosh-jetpack-storybook-twig" ,
7- enforce : "pre" ,
8- transform ( source , id ) {
9- if ( ! id . endsWith ( ".html.twig" ) ) {
10- return null ;
11- }
5+ return {
6+ name : "frosh-jetpack-storybook-twig" ,
7+ enforce : "pre" ,
8+ transform ( source , id ) {
9+ if ( ! id . endsWith ( ".html.twig" ) ) {
10+ return null ;
11+ }
1212
13- const template = source . replaceAll (
14- / \{ % \s * (?: b l o c k \s + [ A - Z a - z 0 - 9 _ ] + | e n d b l o c k ) \s * % \} / g,
15- "" ,
16- ) ;
13+ const template = source . replaceAll (
14+ / \{ % \s * (?: b l o c k \s + [ A - Z a - z 0 - 9 _ ] + | e n d b l o c k ) \s * % \} / g,
15+ "" ,
16+ ) ;
1717
18- return {
19- code : `export default ${ JSON . stringify ( template ) } ;` ,
20- map : null ,
21- } ;
22- } ,
23- } ;
18+ return {
19+ code : `export default ${ JSON . stringify ( template ) } ;` ,
20+ map : null ,
21+ } ;
22+ } ,
23+ } ;
2424}
2525
2626const config : StorybookConfig = {
27- stories : [ "../stories/**/*.mdx" , "../stories/**/*.stories.ts" ] ,
28- addons : [ "@storybook/addon-docs" ] ,
29- framework : {
30- name : "@storybook/vue3-vite" ,
31- options : { } ,
32- } ,
33- core : {
34- disableTelemetry : true ,
35- } ,
36- viteFinal ( viteConfig ) {
37- viteConfig . build = {
38- ...viteConfig . build ,
39- target : "esnext" ,
40- } ;
41- viteConfig . esbuild = {
42- ...viteConfig . esbuild ,
43- target : "esnext" ,
44- } ;
45- viteConfig . plugins = [
46- ...( viteConfig . plugins ?? [ ] ) ,
47- jetpackTwigPlugin ( ) ,
48- ] ;
27+ stories : [ "../stories/**/*.mdx" , "../stories/**/*.stories.ts" ] ,
28+ addons : [ "@storybook/addon-docs" ] ,
29+ framework : {
30+ name : "@storybook/vue3-vite" ,
31+ options : { } ,
32+ } ,
33+ core : {
34+ disableTelemetry : true ,
35+ } ,
36+ viteFinal ( viteConfig ) {
37+ viteConfig . build = {
38+ ...viteConfig . build ,
39+ target : "esnext" ,
40+ } ;
41+ viteConfig . esbuild = {
42+ ...viteConfig . esbuild ,
43+ target : "esnext" ,
44+ // Vite 6 still discovers a local tsconfig when this is an object. A raw JSON string
45+ // deliberately bypasses the Shopware-dependent root tsconfig in standalone CI.
46+ tsconfigRaw : JSON . stringify ( {
47+ compilerOptions : {
48+ useDefineForClassFields : true ,
49+ } ,
50+ } ) ,
51+ } ;
52+ viteConfig . plugins = [ ...( viteConfig . plugins ?? [ ] ) , jetpackTwigPlugin ( ) ] ;
4953
50- return viteConfig ;
51- } ,
54+ return viteConfig ;
55+ } ,
5256} ;
5357
5458export default config ;
0 commit comments