diff --git a/package-lock.json b/package-lock.json index abcb163..1dbbf79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "sass": "^1.49.11", "sass-loader": "^12.6.0", "style-loader": "^3.3.1", + "url-loader": "^4.1.1", "webpack": "^5.71.0", "webpack-cli": "^4.9.2", "webpack-dev-server": "^4.7.4" @@ -7299,6 +7300,51 @@ "punycode": "^2.1.0" } }, + "node_modules/url-loader": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-4.1.1.tgz", + "integrity": "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==", + "dev": true, + "dependencies": { + "loader-utils": "^2.0.0", + "mime-types": "^2.1.27", + "schema-utils": "^3.0.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "file-loader": "*", + "webpack": "^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "file-loader": { + "optional": true + } + } + }, + "node_modules/url-loader/node_modules/schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -13222,6 +13268,30 @@ "punycode": "^2.1.0" } }, + "url-loader": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-4.1.1.tgz", + "integrity": "sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "mime-types": "^2.1.27", + "schema-utils": "^3.0.0" + }, + "dependencies": { + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index f359f42..f38d821 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "sass": "^1.49.11", "sass-loader": "^12.6.0", "style-loader": "^3.3.1", + "url-loader": "^4.1.1", "webpack": "^5.71.0", "webpack-cli": "^4.9.2", "webpack-dev-server": "^4.7.4" diff --git a/src/index.jsx b/src/index.jsx index aec446a..088f9de 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -5,13 +5,19 @@ import { createConfig } from './Config'; import './index.css'; import 'leaflet/dist/leaflet.css'; + +import MarkerIcon from '../public/leaflet/marker-icon.png'; +import MarkerShadow from '../public/leaflet/marker-shadow.png'; +import MarkerIcon2x from '../public/leaflet/marker-icon-2x.png'; +import MarkerShadow2x from '../public/leaflet/marker-shadow-2x.png'; + import GeoTaggingWidget from './GeoTaggingWidget'; L.Icon.Default.mergeOptions({ - iconUrl: 'leaflet/marker-icon.png', - shadowUrl: 'leaflet/marker-shadow.png', - iconRetinaUrl: 'leaflet/marker-icon-2x.png', - shadowRetinaUrl: 'leaflet/marker-shadow-2x.png' + iconUrl: MarkerIcon, + shadowUrl: MarkerShadow, + iconRetinaUrl: MarkerIcon2x, + shadowRetinaUrl: MarkerShadow2x }); const GeoTaggingPlugin = config => props => diff --git a/webpack.config.js b/webpack.config.js index fbd393c..e915d3d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -57,7 +57,8 @@ module.exports = { } }, { test: /\.css$/, use: [ 'style-loader', 'css-loader'] }, - { test: /\.scss$/, use: [ 'style-loader', 'css-loader', 'sass-loader' ] } + { test: /\.scss$/, use: [ 'style-loader', 'css-loader', 'sass-loader' ] }, + { test: /\.png$/, use: [ 'url-loader?mimetype=image/png' ]} ] }, devServer: {