Skip to content

Commit 6c40099

Browse files
committed
Reapply changes from #1439 to the reactotron-apollo-client
1 parent 7ad4929 commit 6c40099

File tree

5 files changed

+78
-453
lines changed

5 files changed

+78
-453
lines changed

lib/reactotron-apollo-client/package.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"build:dev": "yarn tsc && yarn compile:dev",
3636
"clean": "trash dist",
3737
"lint": "eslint 'src/**/**.{ts,tsx}'",
38-
"compile": "NODE_ENV=production rollup -c rollup.config.ts",
39-
"compile:dev": "NODE_ENV=development rollup -c rollup.config.ts",
38+
"compile": "NODE_ENV=production rollup -c --strictDeprecations --bundleConfigAsCjs",
39+
"compile:dev": "NODE_ENV=development rollup -c --strictDeprecations --bundleConfigAsCjs",
4040
"tsc": "tsc",
4141
"typecheck": "tsc",
4242
"ci:test": "yarn test --runInBand"
@@ -50,10 +50,12 @@
5050
},
5151
"devDependencies": {
5252
"@apollo/client": "^3.8.3",
53-
"@babel/core": "^7.21.0",
54-
"@babel/preset-env": "^7.20.2",
55-
"@babel/preset-typescript": "^7.21.0",
56-
"@types/jest": "^29.4.0",
53+
"@babel/core": "^7.23.2",
54+
"@babel/eslint-parser": "^7.23.10",
55+
"@babel/preset-typescript": "^7.23.2",
56+
"@rollup/plugin-replace": "^5.0.5",
57+
"@rollup/plugin-typescript": "11.1.1",
58+
"@types/jest": "^29.5.12",
5759
"@types/node": "^11.9.5",
5860
"@types/ramda": "^0.25.50",
5961
"@typescript-eslint/eslint-plugin": "^5.54.0",
@@ -70,15 +72,12 @@
7072
"eslint-plugin-react-hooks": "^4.6.0",
7173
"eslint-plugin-standard": "^5.0.0",
7274
"graphql": "^16.8.0",
73-
"jest": "^29.4.3",
75+
"jest": "^29.7.0",
7476
"prettier": "^2.8.4",
7577
"reactotron-core-client": "workspace:*",
76-
"rollup": "^1.1.2",
77-
"rollup-plugin-babel": "^4.3.2",
78-
"rollup-plugin-babel-minify": "^7.0.0",
79-
"rollup-plugin-filesize": "^6.0.1",
80-
"rollup-plugin-node-resolve": "^4.0.0",
81-
"rollup-plugin-resolve": "^0.0.1-predev.1",
78+
"rollup": "^4.9.6",
79+
"rollup-plugin-filesize": "^10.0.0",
80+
"rollup-plugin-terser": "^7.0.2",
8281
"testdouble": "^3.16.8",
8382
"trash-cli": "^5.0.0",
8483
"ts-jest": "^29.0.5",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import replace from "@rollup/plugin-replace"
2+
import filesize from "rollup-plugin-filesize"
3+
import { terser } from "rollup-plugin-terser"
4+
import typescript from "@rollup/plugin-typescript"
5+
6+
const pkg = require("./package.json")
7+
8+
/** @type {import('rollup').RollupOptions} */
9+
export default {
10+
input: "src/reactotron-apollo-client.ts",
11+
output: [
12+
{
13+
file: pkg.main,
14+
format: "cjs",
15+
},
16+
{
17+
file: pkg.module,
18+
format: "esm",
19+
},
20+
],
21+
plugins: [
22+
typescript(),
23+
replace({
24+
REACTOTRON_CORE_CLIENT_VERSION: pkg.version,
25+
}),
26+
process.env.NODE_ENV === "production" ? terser() : null,
27+
filesize(),
28+
],
29+
external: ["@apollo/client", "reactotron-core-client", "graphql"],
30+
}

lib/reactotron-apollo-client/rollup.config.ts

-41
This file was deleted.

scripts/generate-plugin.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fs.writeFileSync(
5353
);
5454

5555
fs.writeFileSync(
56-
path.join(targetDir, `rollup.config.ts`),
56+
path.join(targetDir, `rollup.config.cjs`),
5757
createTemplateRollupConfig({ pluginName })
5858
);
5959

0 commit comments

Comments
 (0)