Skip to content

Commit 2b1642b

Browse files
cijiugechucsr632
andauthored
fix: ecosystem-ci (#115)
* fix: ecosystem-ci * bump vite * improve * Revert "bump vite" This reverts commit 7641f56. --------- Co-authored-by: csr632 <[email protected]>
1 parent 9750ccd commit 2b1642b

File tree

1 file changed

+13
-1
lines changed
  • packages/react-pages/src/node/static-site-generation

1 file changed

+13
-1
lines changed

packages/react-pages/src/node/static-site-generation/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { build as viteBuild } from 'vite'
22
import type { ResolvedConfig } from 'vite'
3-
import type { RollupOutput } from 'rollup'
43
import { minify } from 'html-minifier-terser'
54
import * as path from 'path'
65
import fs from 'fs-extra'
@@ -241,3 +240,16 @@ const injectPreload = (html: string, filePath: string) => {
241240
return tag + '\n' + html
242241
}
243242
}
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>

0 commit comments

Comments
 (0)