Skip to content

Commit

Permalink
Merge pull request #24 from Chocolate1999:chore/use-preact
Browse files Browse the repository at this point in the history
chore: convert react to preact in production
  • Loading branch information
Chocolate1999 authored Sep 12, 2022
2 parents 616255f + ddc7cc0 commit 7f4c8d8
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ module.exports = {
dirs: ['src'],
},

// reactStrictMode: true,

// Uncoment to add domain whitelist
images: {
domains: ['res.cloudinary.com'],
},

// webpack: (config, { dev, isServer }) => {
// // Replace React with Preact only in client production build
// if (!dev && !isServer) {
// Object.assign(config.resolve.alias, {
// react: 'preact/compat',
// 'react-dom/test-utils': 'preact/test-utils',
// 'react-dom': 'preact/compat',
// });
// }
webpack: (config, { dev, isServer }) => {
// Replace React with Preact only in client production build
if (!dev && !isServer) {
Object.assign(config.resolve.alias, {
react: 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
'react-dom': 'preact/compat',
});
}

// return config;
// },
return config;
},
};

const intercept = require('intercept-stdout');
Expand Down

1 comment on commit 7f4c8d8

@vercel
Copy link

@vercel vercel bot commented on 7f4c8d8 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.