File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
import * as esbuild from 'esbuild'
2
2
import cssModulesPlugin from 'esbuild-css-modules-plugin'
3
3
import fs from 'fs'
4
+ import pkg from './package.json' assert { type : 'json ' }
4
5
5
6
const buildsConfig = [
6
7
{
@@ -44,6 +45,7 @@ const buildsConfig = [
44
45
minify : true ,
45
46
} ,
46
47
]
48
+ const externals = Object . keys ( { ...( pkg . peerDependencies ?? { } ) , ...( pkg . dependencies ?? { } ) } )
47
49
48
50
const builds = await Promise . all (
49
51
buildsConfig . map ( ( { format, outfile, minify } ) =>
@@ -55,7 +57,7 @@ const builds = await Promise.all(
55
57
treeShaking : true ,
56
58
minify,
57
59
sourcemap : true ,
58
- external : [ 'react' , 'react-dom' , 'prop-types' ] ,
60
+ external : externals ,
59
61
plugins : [
60
62
cssModulesPlugin ( {
61
63
// inject: true,
Original file line number Diff line number Diff line change 36
36
},
37
37
"homepage" : " https://github.com/ReactTooltip/react-tooltip#readme" ,
38
38
"devDependencies" : {
39
+ "@floating-ui/dom" : " ^1.0.0" ,
39
40
"@rollup/plugin-commonjs" : " 22.0.2" ,
40
41
"@rollup/plugin-node-resolve" : " 14.1.0" ,
41
42
"@rollup/plugin-replace" : " 4.0.0" ,
52
53
"@typescript-eslint/eslint-plugin" : " 5.54.0" ,
53
54
"@typescript-eslint/parser" : " 5.54.0" ,
54
55
"bundlesize" : " ^0.18.1" ,
56
+ "classnames" : " ^2.3.0" ,
55
57
"css-loader" : " 6.7.3" ,
56
58
"esbuild" : " 0.17.11" ,
57
59
"esbuild-css-modules-plugin" : " ^2.7.1" ,
71
73
"postcss" : " 8.4.21" ,
72
74
"prettier" : " 2.8.4" ,
73
75
"process" : " ^0.11.10" ,
74
- "prop-types" : " ^ 15.7.2 " ,
76
+ "prop-types" : " >= 15.0.0 " ,
75
77
"react" : " 16.14.0" ,
76
78
"react-dom" : " 16.14.0" ,
77
79
"rimraf" : " ^3.0.2" ,
96
98
"typescript" : " 4.9.5"
97
99
},
98
100
"peerDependencies" : {
101
+ "@floating-ui/dom" : " ^1.0.0" ,
102
+ "classnames" : " ^2.3.0" ,
103
+ "prop-types" : " >=15.0.0" ,
99
104
"react" : " >=16.14.0" ,
100
105
"react-dom" : " >=16.14.0"
101
106
},
110
115
" last 1 firefox version" ,
111
116
" last 1 safari version"
112
117
]
113
- },
114
- "dependencies" : {
115
- "@floating-ui/dom" : " 1.2.3" ,
116
- "classnames" : " ^2.3.2"
117
118
}
118
119
}
You can’t perform that action at this time.
0 commit comments