Skip to content

Commit d1c23eb

Browse files
committed
perf(core): make hoist-non-react-static a peerDep
By pulling it out of the bundle, we save bundle size
1 parent 6397f87 commit d1c23eb

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

examples/ssr/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"body-parser": "^1.19.0",
2626
"compression": "^1.7.4",
2727
"express": "^4.17.1",
28+
"hoist-non-react-statics": "^3.3.0",
2829
"node-fetch": "^2.6.0",
2930
"razzle": "^3.0.0",
3031
"razzle-plugin-typescript": "^3.0.0",

packages/react-isomorphic-data/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"typescript": "^3.7.4"
7373
},
7474
"peerDependencies": {
75+
"hoist-non-react-statics": "^3.3.0",
7576
"react": "^16.8.0",
7677
"react-dom": "^16.8.0"
7778
},

packages/react-isomorphic-data/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const mainBundleConfig = {
5151
{ file: pkg.module, format: 'es', sourcemap: true },
5252
],
5353
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
54-
external: ['react', 'react-dom', 'react-dom/server'],
54+
external: ['react', 'react-dom', 'react-dom/server', 'hoist-non-react-statics'],
5555
watch: {
5656
include: 'src/**',
5757
},
@@ -76,7 +76,7 @@ const serverBundleConfig = {
7676
},
7777
],
7878
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
79-
external: ['react', 'react-dom', 'react-dom/server'],
79+
external: ['react', 'react-dom', 'react-dom/server', 'hoist-non-react-statics'],
8080
watch: {
8181
include: 'src/ssr/**',
8282
},

0 commit comments

Comments
 (0)