You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have separately inculcated react (umd) in html, and react has been linked to the global. However, when you write code in src, you will automatically import react if you use useState or somthing else. So that the output ESM contains the sentence import {use state} from 'react'. How can I replace all the import * from 'react' in the output file with this. React.
Declaring that reactglobal in dts is not a solution, because some dependency packages downloaded from npm also import react
The text was updated successfully, but these errors were encountered:
You can write a plugin that swaps the react package for a module that does module.exports = window.React. An example plugin is in this thread: #337 (comment)
I have separately inculcated react (umd) in html, and react has been linked to the global. However, when you write code in
src
, you will automatically import react if you useuseState
or somthing else. So that the output ESM contains the sentenceimport {use state} from 'react'
. How can I replace all theimport * from 'react'
in the output file withthis. React
.Declaring that
react
global
indts
is not a solution, because some dependency packages downloaded from npm also import reactThe text was updated successfully, but these errors were encountered: