Skip to content

Commit

Permalink
fix: add react and react-dom to external in rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn320 committed Jul 31, 2023
1 parent 976a8b9 commit 8ad6568
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
"last 1 safari version"
]
},
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.5",
Expand Down
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export default [
// anything "external" will not be included into the generated bundle
// https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
external: [
"react",
"react-dom",
// regular dependencies should not be included as they will be automatically installed by the consuming application
...Object.keys(pkg.dependencies || {}),
// peer dependencies should not be included as they are expected to be provided by the consuming application
Expand Down

0 comments on commit 8ad6568

Please sign in to comment.