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 11import * as esbuild from 'esbuild'
22import cssModulesPlugin from 'esbuild-css-modules-plugin'
33import fs from 'fs'
4+ import pkg from './package.json' assert { type : 'json ' }
45
56const buildsConfig = [
67 {
@@ -44,6 +45,7 @@ const buildsConfig = [
4445 minify : true ,
4546 } ,
4647]
48+ const externals = Object . keys ( { ...( pkg . peerDependencies ?? { } ) , ...( pkg . dependencies ?? { } ) } )
4749
4850const builds = await Promise . all (
4951 buildsConfig . map ( ( { format, outfile, minify } ) =>
@@ -55,7 +57,7 @@ const builds = await Promise.all(
5557 treeShaking : true ,
5658 minify,
5759 sourcemap : true ,
58- external : [ 'react' , 'react-dom' , 'prop-types' ] ,
60+ external : externals ,
5961 plugins : [
6062 cssModulesPlugin ( {
6163 // inject: true,
Original file line number Diff line number Diff line change 3636 },
3737 "homepage" : " https://github.com/ReactTooltip/react-tooltip#readme" ,
3838 "devDependencies" : {
39+ "@floating-ui/dom" : " ^1.0.0" ,
3940 "@rollup/plugin-commonjs" : " 22.0.2" ,
4041 "@rollup/plugin-node-resolve" : " 14.1.0" ,
4142 "@rollup/plugin-replace" : " 4.0.0" ,
5253 "@typescript-eslint/eslint-plugin" : " 5.54.0" ,
5354 "@typescript-eslint/parser" : " 5.54.0" ,
5455 "bundlesize" : " ^0.18.1" ,
56+ "classnames" : " ^2.3.0" ,
5557 "css-loader" : " 6.7.3" ,
5658 "esbuild" : " 0.17.11" ,
5759 "esbuild-css-modules-plugin" : " ^2.7.1" ,
7173 "postcss" : " 8.4.21" ,
7274 "prettier" : " 2.8.4" ,
7375 "process" : " ^0.11.10" ,
74- "prop-types" : " ^ 15.7.2 " ,
76+ "prop-types" : " >= 15.0.0 " ,
7577 "react" : " 16.14.0" ,
7678 "react-dom" : " 16.14.0" ,
7779 "rimraf" : " ^3.0.2" ,
9698 "typescript" : " 4.9.5"
9799 },
98100 "peerDependencies" : {
101+ "@floating-ui/dom" : " ^1.0.0" ,
102+ "classnames" : " ^2.3.0" ,
103+ "prop-types" : " >=15.0.0" ,
99104 "react" : " >=16.14.0" ,
100105 "react-dom" : " >=16.14.0"
101106 },
110115 " last 1 firefox version" ,
111116 " last 1 safari version"
112117 ]
113- },
114- "dependencies" : {
115- "@floating-ui/dom" : " 1.2.3" ,
116- "classnames" : " ^2.3.2"
117118 }
118119}
You can’t perform that action at this time.
0 commit comments