forked from GeoTIFF/georaster-layer-for-leaflet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (40 loc) · 915 Bytes
/
webpack.config.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
const path = require("path");
const isLite = process.env.LITE === "true";
module.exports = {
watch: process.env.WEBPACK_WATCH === "true",
entry: "./src/georaster-layer-for-leaflet.ts",
mode: "production",
target: "web",
output: {
filename: "georaster-layer-for-leaflet" + (isLite ? ".lite" : "") + ".min.js",
path: path.resolve(__dirname, "dist"),
library: {
export: "default",
name: "GeoRasterLayer",
type: "umd"
}
},
devtool: "source-map",
module: {
rules: [
{
test: /\.(ts|js)x?$/,
use: {
loader: "babel-loader"
}
},
isLite && {
test: /.*proj4.*/,
use: {
loader: "null-loader"
}
}
].filter(Boolean)
},
resolve: {
modules: ["node_modules"]
},
externals: {
leaflet: { root: "L", commonjs: "leaflet", amd: "leaflet", commonjs2: "leaflet" }
}
};