-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.fatherrc.ts
41 lines (39 loc) · 946 Bytes
/
.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
import { IBundleOptions } from 'father-build/src/types';
const findPath = moduleName => {
console.log(require.resolve(moduleName));
const pathArr = require.resolve(moduleName).split('/');
// console.log(pathArr)
const pathIndex = pathArr.findIndex(path => path === moduleName);
console.log(pathIndex);
const path = `${pathArr.slice(pathIndex).join('/')}`;
console.log(path);
return path;
};
const config: IBundleOptions = {
esm: 'babel',
cjs: 'babel',
// umd: {
// name: "demo",
// globals: {
// react: "React"
// }
// },
extractCSS: true,
lessInBabelMode: true,
extraBabelPlugins: [
[
'babel-plugin-import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: 'css',
},
],
],
namedExports: {
[`${findPath('antd')}`]: ['Divider', '_Divider', 'divider'],
},
runtimeHelpers: true,
disableTypeCheck: false,
};
export default config;