-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
geo-ip update #3
base: main
Are you sure you want to change the base?
Changes from all commits
c8d24ae
93129c7
d317efc
537a504
4c1291b
eb8bc28
ce378fa
e8ade0c
65f92e1
9865288
0ed8c53
e6e6b12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const CopyWebpackPlugin = require("copy-webpack-plugin"); | ||
|
||
module.exports = { | ||
async rewrites() { | ||
return [ | ||
|
@@ -35,4 +37,31 @@ module.exports = { | |
// }, | ||
] | ||
}, | ||
// reactStrictMode: true, | ||
// experimental: { | ||
// serverComponentsExternalPackages: ["geoip-lite"], | ||
// }, | ||
Comment on lines
+40
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification The experimental configuration for geoip-lite should be uncommented The verification reveals that geoip-lite is actively used in multiple API route files (
reactStrictMode: true,
experimental: {
serverComponentsExternalPackages: ["geoip-lite"],
}, 🔗 Analysis chainVerify if experimental configuration is needed. The commented experimental configuration for Let's check if this configuration is necessary: Let me gather more information about the usage of geoip-lite in the codebase. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check if geoip-lite is used in server components
# Look for files that might indicate server component usage
# Check for server components using geoip-lite
rg -l "use client" | xargs rg "geoip-lite"
# Check for potential SSR/server-side usage
rg -l "getServerSideProps|getInitialProps" | xargs rg "geoip-lite"
Length of output: 904 Script: #!/bin/bash
# Search for any imports or requires of geoip-lite
rg "require.*geoip-lite|from.*geoip-lite"
# Search for any API routes or server-side code that might use geoip-lite
fd "api" --type f --exec rg "geoip" {}
# Look for any configuration files that might reference geoip
fd -e config.js -e config.ts --exec rg "geoip" {}
Length of output: 1178 |
||
// webpack: (config, { isServer }) => { | ||
// if (isServer) { | ||
// config.plugins.push( | ||
// new CopyWebpackPlugin({ | ||
// patterns: [ | ||
// { | ||
// from: "node_modules/geoip-lite/data/geoip-country.dat", | ||
// to: "data/geoip-country.dat", | ||
// }, | ||
// { | ||
// from: "node_modules/geoip-lite/data/geoip-country6.dat", | ||
// to: "data/geoip-country6.dat", | ||
// }, | ||
// { | ||
// from: "node_modules/geoip-lite/data/geoip-city-names.dat", | ||
// to: "data/geoip-city-names.dat", | ||
// }, | ||
// ], | ||
// }), | ||
// ); | ||
// } | ||
// return config; | ||
// }, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0bb66f0dd2c9bc09e2dce62b9137b9f35df829462df9f32f6388a571ff38eaa2 GeoLite2-City-CSV_20240716.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
e6275b1e6c08bcf0adcffa06f32993dca51390a43cf7ee7e7d7467e1fe38283a GeoLite2-Country-CSV_20240716.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused import or uncomment webpack configuration.
The
CopyWebpackPlugin
is imported but not actively used since the webpack configuration is commented out. This creates unnecessary bundle size.Either:
-const CopyWebpackPlugin = require("copy-webpack-plugin");