-
Notifications
You must be signed in to change notification settings - Fork 23
/
webpack.config.js
37 lines (35 loc) · 831 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
const path = require('path');
const fs = require('fs');
class CleanOutput {
apply(compiler) {
compiler.hooks.thisCompilation.tap('CleanOutput', () => {
if (fs.existsSync('./index.js')) {
fs.rmSync('./index.js');
}
if (fs.existsSync('./without-countries.js')) {
fs.rmSync('./without-countries.js');
}
});
}
}
module.exports = {
entry: {
index: './src/with-countries.js',
'without-countries': './src/without-countries.js',
},
mode: 'production',
output: {
path: path.resolve(__dirname),
filename: '[name].js',
library: {
name: 'dotted-map',
type: 'umd',
},
globalObject: 'this',
},
externals: {
'@turf/boolean-point-in-polygon': '@turf/boolean-point-in-polygon',
proj4: 'proj4',
},
plugins: [new CleanOutput()],
};