forked from openlayers/ol-mapbox-style
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.olms.js
53 lines (52 loc) · 1.4 KB
/
webpack.config.olms.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const path = require('path');
module.exports = {
entry: './olms.js',
devtool: 'source-map',
node: {fs: 'empty'},
mode: 'production',
module: {
rules: [
{
test: /\.js$/,
include: [
__dirname,
path.resolve(__dirname, 'exmaple'),
/node_modules\/(?!(ol|@mapbox\/mapbox-gl-style-spec)\/)/
],
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
output: {
path: path.resolve('./dist'), // Path of output file
filename: 'olms.js',
library: 'olms',
libraryTarget: 'assign',
libraryExport: 'default'
},
externals: {
'ol/style/Style': 'ol.style.Style',
'ol/style/Circle': 'ol.style.Circle',
'ol/style/Icon': 'ol.style.Icon',
'ol/style/Stroke': 'ol.style.Stroke',
'ol/style/Fill': 'ol.style.Fill',
'ol/geom/Point': 'ol.geom.Point',
'ol/proj': 'ol.proj',
'ol/tilegrid': 'ol.tilegrid',
'ol/format/GeoJSON': 'ol.format.GeoJSON',
'ol/format/MVT': 'ol.format.MVT',
'ol/Map': 'ol.Map',
'ol/Observable': 'ol.Observable',
'ol/layer/Tile': 'ol.layer.Tile',
'ol/layer/Vector': 'ol.layer.Vector',
'ol/layer/VectorTile': 'ol.layer.VectorTile',
'ol/source/TileJSON': 'ol.source.TileJSON',
'ol/source/Vector': 'ol.source.Vector',
'ol/source/VectorTile': 'ol.source.VectorTile'
}
};