Skip to content

Commit

Permalink
fix: build failing with Vite 3 (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jun 8, 2022
1 parent d8d5d33 commit 60eaee0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/vite-node/src/server.ts
Expand Up @@ -25,7 +25,8 @@ export class ViteNodeServer {
public server: ViteDevServer,
public options: ViteNodeServerOptions = {},
) {
// @ts-expect-error ssr is not typed
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore ssr is not typed in Vite 2, but defined in Vite 3, so we can't use expect-error
const ssrOptions = server.config.ssr
if (ssrOptions) {
options.deps ??= {}
Expand Down
3 changes: 2 additions & 1 deletion packages/vitest/src/node/config.ts
Expand Up @@ -94,7 +94,8 @@ export function resolveConfig(
// vitenode will try to import such file with native node,
// but then our mocker will not work properly
if (resolved.deps.inline !== true) {
// @ts-expect-error ssr is not typed
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore ssr is not typed in Vite 2, but defined in Vite 3, so we can't use expect-error
const ssrOptions = viteConfig.ssr || {}

if (ssrOptions.noExternal === true && resolved.deps.inline == null) {
Expand Down

0 comments on commit 60eaee0

Please sign in to comment.