Skip to content

Commit

Permalink
Add back the @mui/*/modern optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Nov 14, 2023
1 parent 001d75b commit f938e5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packagesDev/next-config/dist/withGraphCommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function withGraphCommerce(nextConfig, cwd) {
};
if (!config.resolve)
config.resolve = {};
if (!options.isServer) {
if (!options.isServer && !options.dev) {
config.resolve.alias = {
...config.resolve.alias,
'@mui/base': '@mui/base/modern',
Expand Down
10 changes: 10 additions & 0 deletions packagesDev/next-config/src/withGraphCommerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ export function withGraphCommerce(nextConfig: NextConfig, cwd: string): NextConf
}

if (!config.resolve) config.resolve = {}
if (!options.isServer && !options.dev) {
config.resolve.alias = {
...config.resolve.alias,
'@mui/base': '@mui/base/modern',
'@mui/lab': '@mui/lab/modern',
'@mui/material': '@mui/material/modern',
'@mui/styled-engine': '@mui/styled-engine/modern',
'@mui/system': '@mui/system/modern',
}
}

config.plugins.push(new InterceptorPlugin(graphcommerceConfig))

Expand Down

0 comments on commit f938e5c

Please sign in to comment.