Skip to content

Commit bca508c

Browse files
author
Hardik_B
committed
[FIXED] react as external dependency
1 parent fb2411f commit bca508c

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
dist
3-
.vscode
3+
.vscode
4+
example

build.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
22
const esbuild = require("esbuild");
3+
const { dependencies } = require("./package.json");
34

45
const sharedConfig = {
56
bundle: true,
67
entryPoints: ["./src/index.tsx"],
78
// Treat all dependencies in package.json as externals to keep bundle size to a minimum
9+
external: Object.keys(dependencies),
810
logLevel: "info",
911
minify: true,
1012
sourcemap: true,

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dx-kit/react-conditional-match",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "A flexible and reusable React component for conditionally rendering child elements. The component supports options for handling multiple matching children and custom fallbacks, and is lightweight and easy to use. This component can help simplify complex rendering logic in your React application and remove the need for ternary statements and if else blocks.",
55
"main": "./dist/index.esm.js",
66
"module": "./dist/index.cjs.js",
@@ -45,14 +45,18 @@
4545
"LICENSE",
4646
"README.md"
4747
],
48+
"dependencies": {
49+
"@types/react": "^18.0.28",
50+
"@types/react-dom": "^18.0.11",
51+
"react": "^18.2.0",
52+
"react-dom": "^18.2.0"
53+
},
4854
"devDependencies": {
4955
"@testing-library/jest-dom": "^5.16.5",
5056
"@testing-library/react": "^14.0.0",
5157
"@testing-library/user-event": "^14.4.3",
5258
"@types/jest": "^29.4.0",
5359
"@types/node": "^18.14.2",
54-
"@types/react": "^18.0.28",
55-
"@types/react-dom": "^18.0.11",
5660
"@types/testing-library__jest-dom": "^5.14.5",
5761
"@typescript-eslint/eslint-plugin": "^5.53.0",
5862
"@typescript-eslint/parser": "^5.53.0",
@@ -65,8 +69,6 @@
6569
"eslint-plugin-react-hooks": "^4.6.0",
6670
"jsdom": "^21.1.0",
6771
"prettier": "^2.8.4",
68-
"react": "^18.2.0",
69-
"react-dom": "^18.2.0",
7072
"typescript": "^4.9.5",
7173
"vitest": "^0.29.1"
7274
}

0 commit comments

Comments
 (0)