Skip to content

Commit 87992ed

Browse files
committed
added duplicate package checker for webpack
fixed chakra-ui theme tools duplicate imports absolute style imports in _app.js
1 parent 4b2ce99 commit 87992ed

File tree

4 files changed

+42
-49
lines changed

4 files changed

+42
-49
lines changed

next.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
2+
13
const isProduction = process.env.NODE_ENV === 'production';
24

35
module.exports = {
46
webpack: (config, { dev }) => {
5-
config.optimization.minimize = isProduction;
7+
if (isProduction) {
8+
config.optimization.minimize = true;
9+
config.plugins.push(new DuplicatePackageCheckerPlugin());
10+
}
611
return config;
712
},
8-
reactStrictMode: isProduction,
913
images: {
1014
domains: ["res.cloudinary.com"],
1115
},
@@ -16,4 +20,5 @@ module.exports = {
1620
) {
1721
return { ...defaultPathMap, };
1822
},
23+
reactStrictMode: !isProduction,
1924
}

package-lock.json

Lines changed: 31 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
},
1111
"dependencies": {
1212
"@chakra-ui/core": "^1.0.0-rc.8",
13-
"@chakra-ui/theme-tools": "^1.0.0-next.3",
13+
"@chakra-ui/theme-tools": "^1.0.0-rc.8",
1414
"cross-env": "^7.0.2",
15+
"duplicate-package-checker-webpack-plugin": "^3.0.0",
1516
"framer-motion": "^2.9.4",
1617
"next": "^10.0.1",
1718
"react": "17.0.0",

pages/_app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Head from 'next/head';
22
import { useEffect } from 'react';
33

4-
import '../styles/globals.css'
4+
import '@/styles/globals.css'
55
import { ChakraProvider } from '@chakra-ui/core';
66

7-
import theme from "../styles/themes/theme";
7+
import theme from "@/styles/themes/theme";
88

99
function MyApp({ Component, pageProps }) {
1010

0 commit comments

Comments
 (0)