Skip to content

Commit

Permalink
fix: index-index nested output and logging (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi authored Jul 19, 2024
1 parent 96abb80 commit ac0292d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ async function run(args: CliArgs) {
if (watch) {
logWatcherBuildTime(assetJobs, spinner)
} else {
stopSpinner()
if (assetJobs.length === 0) {
logger.warn(
'The "src" directory does not contain any entry files. ' +
Expand Down
1 change: 0 additions & 1 deletion src/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ export async function collectSourceEntriesByExportPath(
const exportType = getExportTypeFromExportPath(exportPath)
sourceFilesMap[exportType] = indexAbsoluteFile
exportsEntries.set(exportPath, sourceFilesMap)
break
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions test/integration/entry-index-index/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ describe('integration entry-index-index', () => {
{
directory: __dirname,
},
async ({ distDir }) => {
async ({ distDir, stdout }) => {
await assertFilesContent(distDir, {
'index.js': /'index'/,
'default.js': /'index'/,
'react-server.js': /\'react-server\'/,
})

expect(stdout).toContain('dist/react-server.js')
expect(stdout).toContain('dist/default.js')
},
)
})
Expand Down
2 changes: 1 addition & 1 deletion test/integration/entry-index-index/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "entry-index-index",
"exports": {
"react-server": "./dist/react-server.js",
"default": "./dist/index.js"
"default": "./dist/default.js"
}
}

0 comments on commit ac0292d

Please sign in to comment.