Skip to content

Commit

Permalink
Included PNG files into build for easier deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed May 31, 2022
1 parent 09bc8e1 commit c3ae8b2
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 5 deletions.
70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 10 additions & 4 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit c3ae8b2

Please sign in to comment.