@@ -12,18 +12,15 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
1212
1313const entries = glob
1414 . sync ( 'src/**/*.{ts,tsx}' , {
15- ignore : [ 'src/components/index.ts' , 'src/ **/*.stories.{ts,tsx}'] ,
15+ ignore : [ 'src/**/*.stories.{ts,tsx}' ] ,
1616 } )
17- . map ( ( file ) => {
18- const isInComponentsDir = file . includes ( 'src/components/' ) ;
19- return [
20- path . relative (
21- isInComponentsDir ? 'src/components' : 'src' ,
22- file . slice ( 0 , file . length - path . extname ( file ) . length ) ,
23- ) ,
24- path . resolve ( __dirname , file ) ,
25- ] ;
26- } ) ;
17+ . map ( file => ( [
18+ path . relative (
19+ 'src' ,
20+ file . slice ( 0 , file . length - path . extname ( file ) . length ) ,
21+ ) ,
22+ path . resolve ( __dirname , file ) ,
23+ ] ) ) ;
2724
2825/**
2926 * @see https://vitejs.dev/config/
@@ -35,10 +32,6 @@ export default defineConfig({
3532 dts ( {
3633 include : [ 'src/**/*.{ts,tsx}' ] ,
3734 exclude : [ 'src/**/*.stories.{ts,tsx}' ] ,
38- beforeWriteFile : ( filePath , content ) => ( {
39- filePath : filePath . replace ( 'components/' , '' ) ,
40- content : content ,
41- } ) ,
4235 } ) ,
4336 ] ,
4437 resolve : {
@@ -59,6 +52,7 @@ export default defineConfig({
5952 'react' ,
6053 'react/jsx-runtime' ,
6154 'react-dom' ,
55+ './components' ,
6256 ...Object . keys ( dependencies ) ,
6357 ] ,
6458 output : {
0 commit comments