forked from openlayers/ol-mapbox-style
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.olms.js
More file actions
65 lines (62 loc) · 1.54 KB
/
Copy pathwebpack.config.olms.js
File metadata and controls
65 lines (62 loc) · 1.54 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
const path = require('path');
const 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/style/Text': 'ol.style.Text',
'ol/proj': 'ol.proj',
'ol/tilegrid': 'ol.tilegrid',
'ol/tilegrid/TileGrid': 'ol.tilegrid.TileGrid',
'ol/format/GeoJSON': 'ol.format.GeoJSON',
'ol/format/MVT': 'ol.format.MVT',
'ol/Map': 'ol.Map',
'ol/View': 'ol.View',
'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'
};
function createExternals() {
const createdExternals = {};
for (const key in externals) {
createdExternals[key] = {
root: externals[key].split('.'),
commonjs: key,
commonjs2: key,
amd: key
};
}
return createdExternals;
}
module.exports = {
entry: './src/olms.js',
devtool: 'source-map',
node: {fs: 'empty'},
mode: 'production',
module: {
rules: [
{
test: /\.js$/,
include: [
__dirname
],
use: {
loader: 'buble-loader'
}
}
]
},
output: {
path: path.resolve('./dist'), // Path of output file
filename: 'olms.js',
library: 'olms',
libraryTarget: 'umd',
libraryExport: 'default'
},
externals: createExternals()
};