Skip to content

Commit 237dfd5

Browse files
author
Dimitri Kopriwa
committed
fix(namedExports): filling the react dependency list with more named exports
1 parent 19897b4 commit 237dfd5

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

src/index.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ function createConfig(options = {}) {
121121
// which includes a shim containing just the parts the bundle needs.
122122
{
123123
resolveId(importee) {
124-
if (importee === processShim) return importee;
124+
if (importee === processShim) {
125+
return importee;
126+
}
125127
return null;
126128
},
127129
load(id) {
128-
if (id === processShim) return 'export default { argv: [], env: {} }';
130+
if (id === processShim) {
131+
return 'export default { argv: [], env: {} }';
132+
}
129133
return null;
130134
},
131135
},
@@ -137,8 +141,25 @@ function createConfig(options = {}) {
137141
commonjs({
138142
include: 'node_modules/**',
139143
namedExports: {
140-
react: ['cloneElement', 'createElement', 'PropTypes', 'Children', 'Component', 'createContext'],
141-
'react-is': ['isElement', 'isValidElementType', 'ForwardRef'],
144+
react: [
145+
'cloneElement',
146+
'createElement',
147+
'PropTypes',
148+
'Children',
149+
'Component',
150+
'createContext',
151+
'PureComponent',
152+
'createFactory',
153+
'forwardRef',
154+
'lazy',
155+
'createRef',
156+
'memo',
157+
],
158+
'react-is': [
159+
'isElement',
160+
'isValidElementType',
161+
'ForwardRef'
162+
],
142163
...namedExports,
143164
},
144165
...commonjsOptions,

0 commit comments

Comments
 (0)