diff --git a/package.json b/package.json index c5d6a22..05f5fbb 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "rollup": "^1.17.0", "rollup-plugin-babel": "^4.3.3", "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-peer-deps-external": "^2.2.0", "rollup-plugin-terser": "^5.1.1" }, "husky": { diff --git a/rollup.config.js b/rollup.config.js index f8ba061..4e38844 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,6 @@ import babel from "rollup-plugin-babel"; import resolve from "rollup-plugin-node-resolve"; +import peerDepsExternal from "rollup-plugin-peer-deps-external"; import { terser } from "rollup-plugin-terser"; const name = "Name"; @@ -28,11 +29,11 @@ export default { } ], plugins: [ + peerDepsExternal(), resolve(), babel({ exclude: "node_modules/**" }), prod && terser() - ], - external: ["react"] + ] }; diff --git a/yarn.lock b/yarn.lock index 016f5ba..dd42ec4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3267,6 +3267,11 @@ rollup-plugin-node-resolve@^5.2.0: resolve "^1.11.1" rollup-pluginutils "^2.8.1" +rollup-plugin-peer-deps-external@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-peer-deps-external/-/rollup-plugin-peer-deps-external-2.2.0.tgz#99ef9231aa01736f3e9605b7c3084a0d627f665b" + integrity sha512-BmJMHUWQcvjS2dQMwJ7dzvdbwpRChnq4AYk2sTU/4aySt9Kumk8y8W3HhTHss31wxzKb0AC/wsiX1AqDcOBIEA== + rollup-plugin-terser@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.1.1.tgz#e9d2545ec8d467f96ba99b9216d2285aad8d5b66"