-
Notifications
You must be signed in to change notification settings - Fork 12
/
.fatherrc.ts
49 lines (47 loc) · 1.11 KB
/
.fatherrc.ts
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
import { defineConfig } from 'father';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
export default defineConfig({
esm: {
output: 'dist/esm',
},
cjs: {
output: 'dist/cjs',
},
// https://github.com/umijs/father/blob/master/docs/config.md#umd
umd: {
name: 'GPTVis',
output: {
path: 'dist/umd',
filename: 'index.min.js',
},
platform: 'browser',
targets: {
chrome: 51,
},
externals: {
lodash: '_',
'lodash-es': '_',
react: 'React',
'mapbox-gl': {
root: 'mapboxgl',
commonjs: 'mapbox-gl',
commonjs2: 'mapbox-gl',
amd: 'mapbox-gl',
},
'maplibre-gl': {
root: 'maplibregl',
commonjs: 'maplibre-gl',
commonjs2: 'maplibre-gl',
amd: 'maplibre-gl',
},
},
chainWebpack(memo) {
// 关闭压缩方便调试,默认开启
// memo.optimization.minimize(false);
memo
.plugin('webpack-bundle-analyzer')
.use(BundleAnalyzerPlugin, [{ analyzerMode: 'static', openAnalyzer: false }]);
return memo;
},
},
});