diff --git a/.gitignore b/.gitignore index 93bce15..4498108 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ yarn-error.log* /jsx /subsquare /opensquare +/subsquare-public diff --git a/build.mjs b/build.mjs index 18d8626..ce6d16d 100644 --- a/build.mjs +++ b/build.mjs @@ -43,6 +43,12 @@ function gen() { "--dts", "--minify", "--clean", + "--external", + "react", + "--external", + "react-dom", + "--external", + "react/jsx-runtime", ]); if (compileRes.status !== 0) { console.error(compileRes.stderr?.toString?.()); diff --git a/package.json b/package.json index c1d182a..ca00cbb 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,15 @@ "build": "node scripts/transform-svg-currentColor.mjs && node build.mjs", "prepublishOnly": "npm run build" }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + }, "devDependencies": { "@2nthony/prettier-config": "^1.0.2", "@svgr/cli": "^8.0.1", diff --git a/yarn.lock b/yarn.lock index 2892035..64ec54f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -949,6 +949,12 @@ __metadata: tsup: ^6.7.0 typescript: ^5.1.3 vite: ^5.0.12 + peerDependencies: + react: ">=18" + react-dom: ">=18" + peerDependenciesMeta: + react-dom: + optional: true languageName: unknown linkType: soft