File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -158,8 +158,7 @@ export async function generateExports(
158158 name = name . slice ( 0 , - 2 )
159159 }
160160 const isIndex = onlyOneEntry || name === 'index'
161- const outDirRelative = slash ( path . relative ( pkgRoot , chunk . outDir ) )
162- const distFile = `${ outDirRelative ? `./${ outDirRelative } ` : '.' } /${ normalizedName } `
161+ const distFile = join ( pkgRoot , chunk . outDir , normalizedName )
163162
164163 if ( isIndex ) {
165164 name = '.'
@@ -295,10 +294,8 @@ function exportCss(
295294 for ( const chunksByFormat of Object . values ( chunks ) ) {
296295 for ( const chunk of chunksByFormat ) {
297296 if ( chunk . type === 'asset' && RE_CSS . test ( chunk . fileName ) ) {
298- console . log ( chunk )
299-
300- exports [ `./${ chunk . fileName } ` ] =
301- `./${ slash ( path . join ( path . relative ( pkgRoot , chunk . outDir ) , chunk . fileName ) ) } `
297+ const filename = slash ( chunk . fileName )
298+ exports [ `./${ filename } ` ] = join ( pkgRoot , chunk . outDir , filename )
302299 return
303300 }
304301 }
@@ -334,3 +331,8 @@ export function hasExportsTypes(pkg?: PackageJson): boolean {
334331
335332 return false
336333}
334+
335+ function join ( pkgRoot : string , outDir : string , fileName : string ) {
336+ const outDirRelative = slash ( path . relative ( pkgRoot , outDir ) )
337+ return `${ outDirRelative ? `./${ outDirRelative } ` : '.' } /${ fileName } `
338+ }
You can’t perform that action at this time.
0 commit comments