-
-
Notifications
You must be signed in to change notification settings - Fork 187
/
.fatherrc.ts
62 lines (60 loc) · 1.4 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
50
51
52
53
54
55
56
57
58
59
60
61
62
import { codecovWebpackPlugin } from '@codecov/webpack-plugin';
import { defineConfig } from 'father';
class CodecovWebpackPlugin {
private options;
constructor(options = {}) {
this.options = {
enableBundleAnalysis: true,
bundleName: 'webpack-bundle',
gitService: 'github',
disable: false,
...options,
};
}
apply(compiler: any) {
return codecovWebpackPlugin(this.options).apply(compiler);
}
}
export default defineConfig({
plugins: ['@rc-component/father-plugin'],
targets: {
chrome: 80,
},
esm: {
input: 'components/',
ignores: ['**/demo/**', '**/__tests__/**'],
},
cjs: {
input: 'components/',
ignores: ['**/demo/**', '**/__tests__/**'],
},
umd: {
entry: 'components/index.ts',
name: 'antdx',
output: {
path: 'dist/',
filename: 'antdx',
},
sourcemap: true,
generateUnminified: true,
externals: {
react: 'React',
'react-dom': 'ReactDOM',
'@ant-design/cssinjs': 'antdCssinjs',
antd: 'antd',
},
chainWebpack: (memo) => {
if (process.env.NODE_ENV === 'production') {
memo.plugin('codecov').use(CodecovWebpackPlugin, [
{
enableBundleAnalysis: true,
bundleName: 'antdx',
uploadToken: process.env.CODECOV_TOKEN,
gitService: 'github',
},
]);
}
return memo;
},
},
});