Skip to content

Commit

Permalink
fix(analyze): use updated h3 handlers, fixes #187
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Nov 16, 2022
1 parent 7981dcd commit 6e34756
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/nuxt-windicss/src/analyze.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createApp } from 'h3'
import { createApp, fromNodeMiddleware, toNodeListener } from 'h3'
import { ApiMiddleware } from 'windicss-analysis'
import { listen } from 'listhen'
import { dirname, join } from 'pathe'
Expand All @@ -24,14 +24,14 @@ export async function analyze(runtime: { windiOptions: UserOptions; utils: Windi

const app = createApp()

app.use('/api', ApiMiddleware(runtime.windiOptions, { utils: runtime.utils, ...resolvedOptions.analysis }))
app.use('/api', fromNodeMiddleware(ApiMiddleware(runtime.windiOptions, { utils: runtime.utils, ...resolvedOptions.analysis })))

app.use(
sirv(
fromNodeMiddleware(sirv(
join(dirname(resolveModule('windicss-analysis')), 'app'),
{ dev: true, single: true },
),
)),
)

return await listen(app, resolvedOptions.server)
return await listen(toNodeListener(app), resolvedOptions.server)
}

0 comments on commit 6e34756

Please sign in to comment.