diff --git a/next.config.js b/next.config.js index a6e00120..114cb1d8 100644 --- a/next.config.js +++ b/next.config.js @@ -1,11 +1,14 @@ module.exports = { - webpack: (config, { isServer }) => { - // Fixes npm packages that depend on `fs` module - if (!isServer) { - config.node = { - fs: 'empty' - } - } - return config; + // webpack: (config, { isServer }) => { + // // Fixes npm packages that depend on `fs` module + // if (!isServer) { + // config.node = { + // fs: 'empty' + // } + // } + // return config; + // }, + future: { + webpack5: true } }; \ No newline at end of file diff --git a/package.json b/package.json index 4eeb6959..e55aa24b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build", + "build": "rm -rf .next/ && cross-env NODE_ENV=production next build", "start": "next start" }, "dependencies": { @@ -49,6 +49,8 @@ }, "devDependencies": { "autoprefixer": "^10.2.5", + "cross-env": "^7.0.3", + "fast-glob": "^3.2.5", "postcss": "^8.2.10", "tailwindcss": "^2.1.1", "webpack": "^5.33.2" diff --git a/pages/_app.js b/pages/_app.js index 2e8e90dc..5380a351 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -4,6 +4,9 @@ import "../styles/slick.scss"; import "../styles/slick-theme.scss"; import "highlight.js/styles/default.css"; import "../component/Editorjs/tools/embedTool/index.css" +import "../styles/Home.module.scss"; + +import 'tailwindcss/tailwind.css' function MyApp({ Component, pageProps }) { return ( diff --git a/pages/index.js b/pages/index.js index d9b75115..695af616 100644 --- a/pages/index.js +++ b/pages/index.js @@ -8,7 +8,7 @@ import SectionSwag from "../component/layout/SectionSwag/SectionSwag"; import SectionUsers from "../component/layout/SectionUsers/SectionUsers"; import Head from "next/head"; -import "../styles/Home.module.scss"; +// import "../styles/Home.module.scss"; export default function Home() { return ( diff --git a/tailwind.config.js b/tailwind.config.js index 304697de..b2b2d1fb 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,5 +1,10 @@ +// some of the classes used is being purged after build is done. +// solution: https://github.com/tailwindlabs/tailwindcss/issues/4009 +const fg = require('fast-glob'); +const purgeFiles = fg.sync(['./src/pages/**/*.jsx', './src/components/**/*.jsx'], { dot: false }); + module.exports = { - purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"], + purge: purgeFiles, darkMode: false, // or 'media' or 'class' theme: { extend: { diff --git a/yarn.lock b/yarn.lock index a1ede457..34878288 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1365,6 +1365,22 @@ crelt@^1.0.5: resolved "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz" integrity sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA== +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + +cross-spawn@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@3.12.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz" @@ -1685,7 +1701,7 @@ fast-deep-equal@^3.1.1: fast-glob@^3.2.5: version "3.2.5" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== dependencies: "@nodelib/fs.stat" "^2.0.2" @@ -2213,6 +2229,11 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + isobject@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" @@ -2892,6 +2913,11 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz" @@ -3385,6 +3411,18 @@ shallowequal@^1.1.0: resolved "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shell-quote@1.7.2: version "1.7.2" resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz" @@ -4002,6 +4040,13 @@ which-typed-array@^1.1.2: has-symbols "^1.0.1" is-typed-array "^1.1.3" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz"