Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Rollup types from vite after this is published: #116

Closed
github-actions bot opened this issue Mar 14, 2023 · 0 comments · Fixed by #118
Closed

use Rollup types from vite after this is published: #116

github-actions bot opened this issue Mar 14, 2023 · 0 comments · Fixed by #118
Labels

Comments

@github-actions
Copy link
Contributor

vitejs/vite#12316

import type { Rollup } from 'vite'

type RollupOutput = Rollup.RollupOutput

For now, we use this to work around vite-ecosystem-ci error:

#115

https://api.github.com/vitejs/vite-plugin-react-pages/blob/2b1642b36602c7405faa2267b98db18727055fc1/packages/react-pages/src/node/static-site-generation/index.ts#L244

    return tag + '\n' + html
  }
}

// TODO: use Rollup types from vite after this is published:
//  https://github.com/vitejs/vite/pull/12316
// import type { Rollup } from 'vite'
// type RollupOutput = Rollup.RollupOutput
// For now, we use this to work around vite-ecosystem-ci error:
// https://github.com/vitejs/vite-plugin-react-pages/pull/115
type ViteBuildOutput = Awaited<ReturnType<typeof viteBuild>>
type PickArrayLike<T> = T extends Array<unknown> ? T : never
type RollupOutputArray = PickArrayLike<ViteBuildOutput>
type ArrayElement<ArrayType extends unknown[]> =
  ArrayType extends (infer ElementType)[] ? ElementType : never
type RollupOutput = ArrayElement<RollupOutputArray>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants