Skip to content

Commit 4445623

Browse files
authored
Remove PNG imports (#215)
1 parent f860bb4 commit 4445623

File tree

8 files changed

+1
-57
lines changed

8 files changed

+1
-57
lines changed

.storybook/main.js

-5
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ module.exports = {
8888
],
8989
});
9090

91-
config.module.rules.push({
92-
test: /\.png$/i,
93-
type: 'asset/resource'
94-
});
95-
9691
config.resolve.alias = {
9792
...config.resolve.alias,
9893
'@': AppSourceDir,

__mocks__/png.ts

-2
This file was deleted.

custom.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,3 @@ declare module '*.css' {
1111
const styles: { [className: string]: string };
1212
export default styles;
1313
}
14-
15-
declare module '*.png' {
16-
const value: any;
17-
export = value;
18-
}

jest.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66
moduleNameMapper: {
77
'.(css|less|scss)$': 'identity-obj-proxy',
88
'\\.svg$': '<rootDir>/__mocks__/svg.ts',
9-
'\\.png$': '<rootDir>/__mocks__/png.ts',
109
'^@/(.*)$': '<rootDir>/src/$1',
1110
'^@test/(.*)$': '<rootDir>/test/$1',
1211
},

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"@babel/core": "7.20.2",
3939
"@mdx-js/react": "2.1.5",
4040
"@rollup/plugin-commonjs": "23.0.2",
41-
"@rollup/plugin-image": "3.0.1",
4241
"@rollup/plugin-json": "5.0.1",
4342
"@rollup/plugin-node-resolve": "15.0.1",
4443
"@rollup/plugin-typescript": "9.0.2",

rollup.config.mjs

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import resolve from '@rollup/plugin-node-resolve';
22
import commonjs from '@rollup/plugin-commonjs';
33
import typescript from '@rollup/plugin-typescript';
44
import json from '@rollup/plugin-json';
5-
import image from '@rollup/plugin-image';
65
import dts from 'rollup-plugin-dts';
76
import postcss from 'rollup-plugin-postcss';
87
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
@@ -45,7 +44,6 @@ export default [
4544
svgr({ exportType: 'named' }),
4645
postcss(),
4746
terser(),
48-
image(),
4947
],
5048
},
5149
{

src/components/Map/Map.tsx

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import UrlIcon from 'leaflet/dist/images/marker-icon.png';
2-
import RetinaUrlIcon from 'leaflet/dist/images/marker-icon-2x.png';
3-
import ShadowUrlIcon from 'leaflet/dist/images/marker-shadow.png';
4-
import { icon } from 'leaflet';
51
import {
62
AttributionControl,
73
MapContainer,
@@ -94,19 +90,8 @@ export const Map = ({
9490

9591
type LocationMarkerProps = Pick<MapProps, 'markerLocation'>;
9692
function LocationMarker({ markerLocation }: LocationMarkerProps) {
97-
const markerIcon = icon({
98-
iconUrl: UrlIcon,
99-
iconRetinaUrl: RetinaUrlIcon,
100-
shadowUrl: ShadowUrlIcon,
101-
iconSize: [25, 41],
102-
iconAnchor: [12, 41],
103-
});
104-
10593
return markerLocation ? (
106-
<Marker
107-
position={locationToTuple(markerLocation)}
108-
icon={markerIcon}
109-
/>
94+
<Marker position={locationToTuple(markerLocation)} />
11095
) : null;
11196
}
11297

yarn.lock

-25
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ __metadata:
2323
"@radix-ui/react-popover": ^1.0.0
2424
"@react-hookz/web": ^19.0.0
2525
"@rollup/plugin-commonjs": 23.0.2
26-
"@rollup/plugin-image": 3.0.1
2726
"@rollup/plugin-json": 5.0.1
2827
"@rollup/plugin-node-resolve": 15.0.1
2928
"@rollup/plugin-typescript": 9.0.2
@@ -3360,21 +3359,6 @@ __metadata:
33603359
languageName: node
33613360
linkType: hard
33623361

3363-
"@rollup/plugin-image@npm:3.0.1":
3364-
version: 3.0.1
3365-
resolution: "@rollup/plugin-image@npm:3.0.1"
3366-
dependencies:
3367-
"@rollup/pluginutils": ^5.0.1
3368-
mini-svg-data-uri: ^1.4.4
3369-
peerDependencies:
3370-
rollup: ^1.20.0||^2.0.0||^3.0.0
3371-
peerDependenciesMeta:
3372-
rollup:
3373-
optional: true
3374-
checksum: a48e35f482189d27c608fb9ccc69128a70210cd3fa3ddcfa249fd99a337c9518bfd8bfce9da97cf4ee8c37833bdbfde76806603628036af79e4ea1d60c2e49f4
3375-
languageName: node
3376-
linkType: hard
3377-
33783362
"@rollup/plugin-json@npm:5.0.1":
33793363
version: 5.0.1
33803364
resolution: "@rollup/plugin-json@npm:5.0.1"
@@ -14813,15 +14797,6 @@ __metadata:
1481314797
languageName: node
1481414798
linkType: hard
1481514799

14816-
"mini-svg-data-uri@npm:^1.4.4":
14817-
version: 1.4.4
14818-
resolution: "mini-svg-data-uri@npm:1.4.4"
14819-
bin:
14820-
mini-svg-data-uri: cli.js
14821-
checksum: 997f1fbd8d59a70f03761e18626d335197a3479cb9d1ff75678e4b64b864d32a0b8fc18115eabde035e5299b8b4a354a78e57dd6ac10f9d604162a6170898d09
14822-
languageName: node
14823-
linkType: hard
14824-
1482514800
"minimalistic-assert@npm:^1.0.0, minimalistic-assert@npm:^1.0.1":
1482614801
version: 1.0.1
1482714802
resolution: "minimalistic-assert@npm:1.0.1"

0 commit comments

Comments
 (0)