Closed Nefcanto closed 2 years ago
Hi! You can use ProvidePlugin
Not sure if this is a good solution, but still
const { ProvidePlugin } = require('webpack');
...
webpack: {
plugins: {
add: [
new ProvidePlugin({
React: 'react',
}),
],
},
...
This is a duplicate of: https://github.com/pradel/create-react-app-esbuild/issues/7
Closing the issue as it's a duplicate.
Hi
I used your guide to migrate to CRA + esbuild.
I have a simple component in my source:
And after upgrading to your library I receive this error:
And when I remove this file, it keeps complaining about
React is not defined
in all of my components one after the other.This is my
craco.config.js
:What am I doing wrong? How can I fix this bug?