File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/ladle/lib/cli/vite-plugin/parse Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ const getNamedExports = (
2323 } ,
2424 astPath ,
2525) => {
26+ if ( ! astPath ?. node ?. declaration && ! astPath ?. node ?. specifiers ) return ;
27+
2628 /**
2729 * @param {any } namedExportDeclaration
2830 * @param {string } namedExport
@@ -79,7 +81,10 @@ const getNamedExports = (
7981 if ( namedExportDeclaration . type === "ClassDeclaration" ) {
8082 namedExport = namedExportDeclaration . id . name ;
8183 } else if ( namedExportDeclaration . type === "VariableDeclaration" ) {
82- namedExport = namedExportDeclaration . declarations [ 0 ] . id . name ;
84+ // Skip TITLE constant export
85+ const declaration = namedExportDeclaration . declarations [ 0 ] ;
86+ if ( declaration . id . name === "TITLE" ) return ;
87+ namedExport = declaration . id . name ;
8388 } else if ( namedExportDeclaration . type === "FunctionDeclaration" ) {
8489 namedExport = namedExportDeclaration . id . name ;
8590 } else {
@@ -94,6 +99,8 @@ const getNamedExports = (
9499 astPath . node ?. specifiers . forEach (
95100 /** type * @param {any } specifier */
96101 ( specifier ) => {
102+ // Skip TITLE export
103+ if ( specifier . exported . name === "TITLE" ) return ;
97104 const namedExport = specifier . exported . name ;
98105 const story = namedExportToStory ( specifier , namedExport ) ;
99106 stories . push ( story ) ;
You can’t perform that action at this time.
0 commit comments