From 8ad656802c1fe653f0b260e751453e8d9573db98 Mon Sep 17 00:00:00 2001 From: Shawn Date: Mon, 31 Jul 2023 15:10:00 -0400 Subject: [PATCH] fix: add react and react-dom to external in rollup --- package.json | 4 ++++ rollup.config.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 5c816b10..a4cf74f4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/rollup.config.js b/rollup.config.js index 8aa6abab..009302fe 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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