File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/react-pages/src/node/static-site-generation Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { build as viteBuild } from 'vite'
2
2
import type { ResolvedConfig } from 'vite'
3
- import type { RollupOutput } from 'rollup'
4
3
import { minify } from 'html-minifier-terser'
5
4
import * as path from 'path'
6
5
import fs from 'fs-extra'
@@ -241,3 +240,16 @@ const injectPreload = (html: string, filePath: string) => {
241
240
return tag + '\n' + html
242
241
}
243
242
}
243
+
244
+ // TODO: use Rollup types from vite after this is published:
245
+ // https://github.com/vitejs/vite/pull/12316
246
+ // import type { Rollup } from 'vite'
247
+ // type RollupOutput = Rollup.RollupOutput
248
+ // For now, we use this to work around vite-ecosystem-ci error:
249
+ // https://github.com/vitejs/vite-plugin-react-pages/pull/115
250
+ type ViteBuildOutput = Awaited < ReturnType < typeof viteBuild > >
251
+ type PickArrayLike < T > = T extends Array < unknown > ? T : never
252
+ type RollupOutputArray = PickArrayLike < ViteBuildOutput >
253
+ type ArrayElement < ArrayType extends unknown [ ] > =
254
+ ArrayType extends ( infer ElementType ) [ ] ? ElementType : never
255
+ type RollupOutput = ArrayElement < RollupOutputArray >
You can’t perform that action at this time.
0 commit comments