Skip to content

Commit

Permalink
chore: alias react so that we can use hooks of packages linked
Browse files Browse the repository at this point in the history
  • Loading branch information
satazor committed May 21, 2019
1 parent 2d89cf9 commit 28b6c9f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ module.exports = {
},
},
plugins: [
// Setup aliases
{
plugin: {
overrideWebpackConfig: ({ webpackConfig }) => {
// Make react hooks work when libraries are linked: https://github.com/webpack/webpack/issues/8607
webpackConfig.resolve.alias.react = require.resolve('react');

return webpackConfig;
},
},
},
// Setup babel-loader to use babel.config.js
{
plugin: {
Expand Down

0 comments on commit 28b6c9f

Please sign in to comment.