Skip to content

Instantly share code, notes, and snippets.

@jeremejazz
Last active July 16, 2020 20:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremejazz/6f5486627a37db4597f581da505cd2c1 to your computer and use it in GitHub Desktop.
Save jeremejazz/6f5486627a37db4597f581da505cd2c1 to your computer and use it in GitHub Desktop.
Leaflet Webpack Sample
import L from 'leaflet';
import 'leaflet/dist/leaflet.css';
import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.webpack.css'; // Re-uses images from ~leaflet package
const path = require('path');
module.exports = {
entry: './src/app.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.png$/,
use: [
'file-loader'
]
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment