Skip to content

Commit

Permalink
fix incorrect check
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed Jul 14, 2022
1 parent 58c4795 commit 43f2166
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion npm/vite-dev-server/src/plugins/react18.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ export const React18 = (projectRoot: string): Plugin => {
transform (code, id) {
const isUsingLegacyApi = usingReactWithLegacyAPI(projectRoot)

console.log({ id, isUsingLegacyApi })

if (!isUsingLegacyApi) {
return
}

// TODO: Why do we need to check against cypress-react (dev mode, system tests)
// AND cypress_react (production)?
const isCypressReact = ['cypress-react.esm-bundler.js', 'cypress_react.js'].includes(id)
const isCypressReact = id.includes('cypress-react.esm-bundler.js') || id.includes('cypress_react.js')

if (isCypressReact) {
// remove problematic code via transform!
Expand Down

0 comments on commit 43f2166

Please sign in to comment.