From 13664a1cb48ef48c1e29d068a3d7d84282bbdefe Mon Sep 17 00:00:00 2001 From: Mark Rickert Date: Wed, 14 Feb 2024 11:38:00 -0700 Subject: [PATCH] Export the apollo-client properly. --- lib/reactotron-apisauce/rollup.config.cjs | 29 +++++++++++++++++++ .../rollup.config.cjs | 2 +- lib/reactotron-apollo-client/src/index.ts | 2 ++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 lib/reactotron-apisauce/rollup.config.cjs diff --git a/lib/reactotron-apisauce/rollup.config.cjs b/lib/reactotron-apisauce/rollup.config.cjs new file mode 100644 index 000000000..0b42c02f1 --- /dev/null +++ b/lib/reactotron-apisauce/rollup.config.cjs @@ -0,0 +1,29 @@ +import replace from "@rollup/plugin-replace" +import filesize from "rollup-plugin-filesize" +import { terser } from "rollup-plugin-terser" +import typescript from "@rollup/plugin-typescript" + +const pkg = require("./package.json") + +/** @type {import('rollup').RollupOptions} */ +export default { + input: "src/index.ts", + output: [ + { + file: pkg.main, + format: "cjs", + }, + { + file: pkg.module, + format: "esm", + }, + ], + plugins: [ + typescript(), + replace({ + REACTOTRON_CORE_CLIENT_VERSION: pkg.version, + }), + process.env.NODE_ENV === "production" ? terser() : null, + filesize(), + ], +} diff --git a/lib/reactotron-apollo-client/rollup.config.cjs b/lib/reactotron-apollo-client/rollup.config.cjs index ba244acd8..c26b84d94 100644 --- a/lib/reactotron-apollo-client/rollup.config.cjs +++ b/lib/reactotron-apollo-client/rollup.config.cjs @@ -7,7 +7,7 @@ const pkg = require("./package.json") /** @type {import('rollup').RollupOptions} */ export default { - input: "src/reactotron-apollo-client.ts", + input: "src/index.ts", output: [ { file: pkg.main, diff --git a/lib/reactotron-apollo-client/src/index.ts b/lib/reactotron-apollo-client/src/index.ts index 58ce7e42a..6a473801c 100644 --- a/lib/reactotron-apollo-client/src/index.ts +++ b/lib/reactotron-apollo-client/src/index.ts @@ -1 +1,3 @@ +import apolloClient from "./reactotron-apollo-client" export * from "./reactotron-apollo-client" +export default apolloClient