@@ -2,9 +2,8 @@ import { isBooleanAttr } from '@vue/shared'
22import escape from 'escape-html'
33import fs from 'fs-extra'
44import path from 'path'
5- import type { OutputAsset , OutputChunk , RollupOutput } from 'rollup'
65import { pathToFileURL } from 'url'
7- import { normalizePath , transformWithEsbuild } from 'vite'
6+ import { normalizePath , transformWithEsbuild , type Rollup } from 'vite'
87import type { SiteConfig } from '../config'
98import {
109 EXTERNAL_URL_RE ,
@@ -23,9 +22,9 @@ export async function renderPage(
2322 render : ( path : string ) => Promise < SSGContext > ,
2423 config : SiteConfig ,
2524 page : string , // foo.md
26- result : RollupOutput | null ,
27- appChunk : OutputChunk | null ,
28- cssChunk : OutputAsset | null ,
25+ result : Rollup . RollupOutput | null ,
26+ appChunk : Rollup . OutputChunk | null ,
27+ cssChunk : Rollup . OutputAsset | null ,
2928 assets : string [ ] ,
3029 pageToHashMap : Record < string , string > ,
3130 metadataScript : { html : string ; inHead : boolean } ,
@@ -137,7 +136,7 @@ export async function renderPage(
137136 ( chunk ) =>
138137 chunk . type === 'chunk' &&
139138 chunk . facadeModuleId === slash ( path . join ( config . srcDir , page ) )
140- ) as OutputChunk
139+ ) as Rollup . OutputChunk
141140 if ( matchingChunk ) {
142141 if ( ! matchingChunk . code . includes ( 'import' ) ) {
143142 inlinedScript = `<script type="module">${ matchingChunk . code } </script>`
@@ -198,8 +197,8 @@ export async function renderPage(
198197function resolvePageImports (
199198 config : SiteConfig ,
200199 page : string ,
201- result : RollupOutput ,
202- appChunk : OutputChunk
200+ result : Rollup . RollupOutput ,
201+ appChunk : Rollup . OutputChunk
203202) {
204203 page = config . rewrites . inv [ page ] || page
205204 // find the page's js chunk and inject script tags for its imports so that
@@ -214,7 +213,7 @@ function resolvePageImports(
214213 srcPath = normalizePath ( srcPath )
215214 const pageChunk = result . output . find (
216215 ( chunk ) => chunk . type === 'chunk' && chunk . facadeModuleId === srcPath
217- ) as OutputChunk
216+ ) as Rollup . OutputChunk
218217 return [
219218 ...appChunk . imports ,
220219 ...appChunk . dynamicImports ,
0 commit comments