forked from ant-design/x
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.fatherrc.ts
More file actions
94 lines (92 loc) · 2.23 KB
/
.fatherrc.ts
File metadata and controls
94 lines (92 loc) · 2.23 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { codecovWebpackPlugin } from '@codecov/webpack-plugin';
import DuplicatePackageCheckerPlugin from '@madccc/duplicate-package-checker-webpack-plugin';
import CircularDependencyPlugin from 'circular-dependency-plugin';
import { defineConfig } from 'father';
class CodecovWebpackPlugin {
private options;
constructor(options = {}) {
this.options = 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',
bundler: 'utoopack',
output: {
path: 'dist/',
filename: 'antdx',
},
sourcemap: true,
generateUnminified: true,
concatenateModules: true,
externals: {
react: {
root: 'React',
commonjs: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs: 'react-dom',
},
'@ant-design/cssinjs': {
root: 'antdCssinjs',
commonjs: 'antdCssinjs',
},
'@ant-design/icons': {
root: 'icons',
commonjs: 'icons',
},
dayjs: {
root: 'dayjs',
commonjs: 'dayjs',
},
antd: {
root: 'antd',
commonjs: 'antd',
},
},
transformRuntime: {
absoluteRuntime: process.cwd(),
},
chainWebpack: (memo, { env }) => {
if (env === 'production') {
memo.plugin('codecov').use(CodecovWebpackPlugin, [
{
enableBundleAnalysis: true,
bundleName: 'antdx',
uploadToken: process.env.CODECOV_TOKEN,
gitService: 'github',
},
]);
memo.plugin('circular-dependency-checker').use(CircularDependencyPlugin, [
{
failOnError: true,
},
]);
memo.plugin('duplicate-package-checker').use(DuplicatePackageCheckerPlugin, [
{
verbose: true,
emitError: true,
},
]);
}
return memo;
},
},
});