Skip to content

Commit

Permalink
feat: add special case handle geoip-lite
Browse files Browse the repository at this point in the history
  • Loading branch information
kongmoumou committed Oct 22, 2024
1 parent 3449034 commit f4593ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils/special-cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,15 @@ const specialCases: Record<string, (o: SpecialCaseOpts) => void> = {
emitDependency(resolve(dirname(id), 'bin/pixelmatch'));
}
},
'geoip-lite'({ id, emitAsset }) {
if (id.endsWith('geoip-lite/lib/geoip.js')) {
emitAsset(resolve(dirname(id), '../data/geoip-city.dat'));
emitAsset(resolve(dirname(id), '../data/geoip-city6.dat'));
emitAsset(resolve(dirname(id), '../data/geoip-city-names.dat'));
emitAsset(resolve(dirname(id), '../data/geoip-country.dat'));
emitAsset(resolve(dirname(id), '../data/geoip-country6.dat'));
}
},
};

interface SpecialCaseOpts {
Expand Down

0 comments on commit f4593ed

Please sign in to comment.