Skip to content

Commit d8b86e3

Browse files
Abdulnasır OlcanAbdulnasır Olcan
Abdulnasır Olcan
authored and
Abdulnasır Olcan
committed
🚀 initial comment
1 parent f6e00b9 commit d8b86e3

File tree

4 files changed

+1015
-21
lines changed

4 files changed

+1015
-21
lines changed

.husky/pre-commit

100644100755
File mode changed.

next.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,22 @@ module.exports = withBundleAnalyzer({
1212
basePath: '',
1313
reactStrictMode: true,
1414
swcMinify: true,
15+
webpack: (config, { dev, isServer }) => {
16+
config.module.rules.push({
17+
test: /\.svg$/,
18+
use: ['@svgr/webpack'],
19+
})
20+
21+
if (!dev && !isServer) {
22+
// Replace React with Preact only in client production build
23+
Object.assign(config.resolve.alias, {
24+
'react/jsx-runtime.js': 'preact/compat/jsx-runtime',
25+
react: 'preact/compat',
26+
'react-dom/test-utils': 'preact/test-utils',
27+
'react-dom': 'preact/compat',
28+
})
29+
}
30+
31+
return config
32+
},
1533
});

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"start": "next start",
1313
"lint": "next lint",
1414
"test": "jest",
15+
"analyze": "cross-env ANALYZE=true next build",
1516
"format": "prettier \"./**/*.{ts,tsx}\" --write",
1617
"check": "eslint --ext .ts,.tsx/ --fix",
1718
"generate": "yarn plop --plopfile ./generators/plopfile.js",
@@ -21,11 +22,13 @@
2122
"axios": "^0.27.2",
2223
"next": "^12.2.0",
2324
"next-seo": "^5.4.0",
25+
"preact": "^10.9.0",
2426
"react": "^18.2.0",
2527
"react-dom": "^18.2.0"
2628
},
2729
"devDependencies": {
2830
"@next/bundle-analyzer": "^12.2.0",
31+
"@svgr/webpack": "^6.2.1",
2932
"@testing-library/dom": "^8.16.0",
3033
"@testing-library/jest-dom": "^5.16.4",
3134
"@testing-library/react": "^13.3.0",
@@ -35,6 +38,7 @@
3538
"@typescript-eslint/eslint-plugin": "^5.30.5",
3639
"@typescript-eslint/parser": "^5.30.5",
3740
"autoprefixer": "^10.4.7",
41+
"cross-env": "^7.0.3",
3842
"cssnano": "^5.1.12",
3943
"eslint": "^8.19.0",
4044
"eslint-config-next": "^12.2.2",

0 commit comments

Comments
 (0)