Skip to content
Discussion options

You must be logged in to vote

My current solution is to configure preact/compact (alias react to use preact) in my webpack

const config = { 
   //...snip
  "resolve": { 
    "alias": { 
      "react": "preact/compat",
      "react-dom/test-utils": "preact/test-utils",
      "react-dom": "preact/compat",     // Must be below test-utils
      "react/jsx-runtime": "preact/jsx-runtime"
    },
  }
}

mentioned in preact docs to use the following for nodejs

{
  "dependencies": {
    "react": "npm:@preact/compat",
    "react-dom": "npm:@preact/compat",
  }
}

hope this helps others.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wjlee2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant