Skip to content

Commit 71ae278

Browse files
committed
build: support cjs production
1 parent 4093410 commit 71ae278

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

.fatherrc.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import { defineConfig } from 'father';
33
export default defineConfig({
44
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
55
esm: { output: 'esm', ignores: ['**/demos/**'], transformer: 'babel' },
6+
cjs: { output: 'lib', ignores: ['**/demos/**'], transformer: 'babel' },
67
extraBabelPlugins: ['./plugins/replaceRouter'],
78
});

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
/esm
3+
/lib
34
.dumi/tmp
45
.dumi/tmp-test
56
.dumi/tmp-production

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "4.0.0",
44
"description": "react-component",
55
"repository": "https://github.com/DTStack/dt-react-component",
6+
"main": "lib/index.js",
67
"module": "esm/index.js",
78
"types": "esm/index.d.ts",
89
"scripts": {
@@ -26,6 +27,7 @@
2627
],
2728
"license": "MIT",
2829
"files": [
30+
"lib",
2931
"esm"
3032
],
3133
"keywords": [

0 commit comments

Comments
 (0)