Closed gozeon closed 3 years ago
This would be nice, as since typescript 4.2 a warning is thrown when importing React saying 'React' is declared but its value is never read
Related stackoverflow issue https://stackoverflow.com/questions/66358237/react-is-declared-but-its-value-is-never-read-in-ts-4-2?noredirect=1#comment117315694_66358237
Webpack has a built-in solution for this via ProvidePlugin.
Hello together, that is not the same!
import {h, Fragment} from 'preact';
?!
plugins: [
new webpack.ProvidePlugin({
'{h, Fragment}': 'preact'
})
]
Hello together, that is not the same!
import {h, Fragment} from 'preact';
?!plugins: [ new webpack.ProvidePlugin({ '{h, Fragment}': 'preact' }) ]
{
loader: 'jsx',
jsxFactory: 'Preact.createElement' // or Preact.h
}
Hi @gozeon
thats not the same, too.
jsxInject enabled to remove all for JSX needed React or Preact imports.
Take a Look at vite or snowpack
@deleonio
Consider opening a question in Discussions for configuration help with Preact. This thread is originally about React, and Provide Plugin is demonstrated to be a valid solution here. Make sure your goal and blockers are clearly communicated.
This is a closed thread so it doesn't get much visibility. Not to mention, no one has provided a clear description of the problem so it's not great for discoverability either.