File tree Expand file tree Collapse file tree 4 files changed +30
-10
lines changed Expand file tree Collapse file tree 4 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 3
3
< head >
4
4
< title > Leaflet Control Geocoder</ title >
5
5
< meta charset ="utf-8 " />
6
- < link rel ="stylesheet " href ="./node_modules/leaflet/dist/leaflet.css " />
7
- < link
8
- rel ="stylesheet "
9
- href ="./node_modules/leaflet-control-geocoder/dist/Control.Geocoder.css "
10
- />
6
+ < link rel ="stylesheet " href ="./dist/leaflet.css " />
11
7
</ head >
12
8
< body >
13
9
< div id ="map " style ="width: 600px; height: 400px; "> </ div >
14
- < script src ="./bundle .js "> </ script >
10
+ < script src ="./dist/leaflet .js "> </ script >
15
11
</ body >
16
12
</ html >
Original file line number Diff line number Diff line change 1
1
import L from 'leaflet' ;
2
2
import 'leaflet-control-geocoder' ;
3
3
4
+ import 'leaflet/dist/leaflet.css' ;
5
+ import 'leaflet-control-geocoder/dist/Control.Geocoder.css' ;
6
+
4
7
var map = L . map ( 'map' ) . setView ( [ 0 , 0 ] , 2 ) ;
5
8
L . tileLayer ( 'https://{s}.tile.osm.org/{z}/{x}/{y}.png' , {
6
9
attribution : '© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
Original file line number Diff line number Diff line change 9
9
"leaflet-control-geocoder" : " ^1.8.0"
10
10
},
11
11
"devDependencies" : {
12
- "webpack" : " ^4.33.0" ,
13
- "webpack-cli" : " ^3.3.3"
12
+ "css-loader" : " ^5.0.0" ,
13
+ "file-loader" : " ^6.2.0" ,
14
+ "mini-css-extract-plugin" : " ^1.2.1" ,
15
+ "webpack" : " ^5.3.0" ,
16
+ "webpack-cli" : " ^4.1.0"
14
17
}
15
18
}
Original file line number Diff line number Diff line change 1
1
/* eslint-env node */
2
+ const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
3
+
2
4
module . exports = {
3
5
mode : 'production' ,
4
- entry : './main.js' ,
6
+ entry : {
7
+ leaflet : './main.js'
8
+ } ,
5
9
output : {
6
- filename : './bundle.js'
10
+ publicPath : ''
11
+ } ,
12
+ plugins : [ new MiniCssExtractPlugin ( ) ] ,
13
+
14
+ module : {
15
+ rules : [
16
+ {
17
+ test : / \. c s s $ / ,
18
+ use : [ MiniCssExtractPlugin . loader , 'css-loader' ]
19
+ } ,
20
+ {
21
+ test : / \. ( p n g | g i f ) $ / ,
22
+ use : [ 'file-loader' ]
23
+ }
24
+ ]
7
25
}
8
26
} ;
You can’t perform that action at this time.
0 commit comments