Skip to content

Commit

Permalink
fix: remove deprecated warning due to CJS import of vite react plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 29, 2024
1 parent a2c8ba8 commit 76b878c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sanity/src/_internal/cli/server/getViteConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'node:path'

import {type ReactCompilerConfig, type UserViteConfig} from '@sanity/cli'
import viteReact from '@vitejs/plugin-react'
import debug from 'debug'
import readPkgUp from 'read-pkg-up'
import {type ConfigEnv, type InlineConfig} from 'vite'
Expand Down Expand Up @@ -88,6 +87,7 @@ export async function getViteConfig(options: ViteOptions): Promise<InlineConfig>
const defaultFaviconsPath = path.join(path.dirname(sanityPkgPath), 'static', 'favicons')
const staticPath = `${basePath}static`

const {default: viteReact} = await import('@vitejs/plugin-react')
const viteConfig: InlineConfig = {
// Define a custom cache directory so that sanity's vite cache
// does not conflict with any potential local vite projects
Expand Down

0 comments on commit 76b878c

Please sign in to comment.