Skip to content

Commit

Permalink
fix(build): exclude react from bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenOutman committed Apr 2, 2022
1 parent 496fef4 commit 8255d98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts",
"build": "tsup src/index.ts --clean --format cjs,esm --dts --inject ./react-import.js --external react",
"test": "jest",
"prepublishOnly": "pnpm run build"
},
Expand Down
5 changes: 5 additions & 0 deletions react-import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// react-import.js
// @see https://github.com/egoist/tsup/issues/390#issuecomment-933488738
import React from "react";

export { React };

0 comments on commit 8255d98

Please sign in to comment.