Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Jan 22, 2025
1 parent 1d04fc9 commit 088e478
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/waku/src/lib/middleware/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,13 @@ export const handler: Middleware = (options) => {
: ('Error: loadEntries are not available' as never);
const configPromise =
options.cmd === 'start'
? entriesPromise.then((entries) =>
entries.loadConfig().then((config) => resolveConfig(config)),
)
? entriesPromise.then(async (entries) => {
if (entries.buildData) {
unstable_getPlatformObject().buildData = entries.buildData;
}
return resolveConfig(await entries.loadConfig());
})
: resolveConfig(options.config);
if (options.cmd === 'start') {
entriesPromise
.then((entries) => {
if (entries.buildData) {
unstable_getPlatformObject().buildData = entries.buildData;
}
})
.catch(() => {});
}

return async (ctx, next) => {
const { unstable_devServer: devServer } = ctx;
Expand Down

0 comments on commit 088e478

Please sign in to comment.