12
// .stable.js
13
// .experimental.js
14
// .js
15
+ // or any of those plus .development.js
16
+
17
if (isFBBundle) {
18
// FB builds for react-dom need to alias both react-dom and react-dom/client to the same
19
// entrypoint since there is only a single build for them.
43
}
44
45
resolvedEntry = nodePath.join(resolvedEntry, '..', entrypoint);
46
+ const developmentEntry = resolvedEntry.replace('.js', '.development.js');
47
+ if (fs.existsSync(developmentEntry)) {
48
+ return developmentEntry;
49
+ }
50
if (fs.existsSync(resolvedEntry)) {
51
return resolvedEntry;
52
}
59
'.js',
60
__EXPERIMENTAL__ ? '.modern.fb.js' : '.classic.fb.js'
61
);
62
+ const devFBEntry = resolvedFBEntry.replace('.js', '.development.js');
63
+ if (fs.existsSync(devFBEntry)) {
64
+ return devFBEntry;
65
+ }
66
if (fs.existsSync(resolvedFBEntry)) {
67
return resolvedFBEntry;
68
}
76
'.js',
77
__EXPERIMENTAL__ ? '.experimental.js' : '.stable.js'
78
);
79
+ const devForkedEntry = resolvedForkedEntry.replace('.js', '.development.js');
80
+ if (fs.existsSync(devForkedEntry)) {
81
+ return devForkedEntry;
82
+ }
83
if (fs.existsSync(resolvedForkedEntry)) {
84
return resolvedForkedEntry;
85
}
86
+ const plainDevEntry = resolvedEntry.replace('.js', '.development.js');
87
+ if (fs.existsSync(plainDevEntry)) {
88
+ return plainDevEntry;
89
+ }
90
// Just use the plain .js one.
91
return resolvedEntry;
92
}
95
jest.mock('react', () => {
96
const resolvedEntryPoint = resolveEntryFork(
97
require.resolve('react'),
80
- global.__WWW__ || global.__XPLAT__
98
+ global.__WWW__ || global.__XPLAT__,
99
+ global.__DEV__
100
);
101
return jest.requireActual(resolvedEntryPoint);
102
});
119
});
120
const resolvedEntryPoint = resolveEntryFork(
121
require.resolve('react/src/ReactServer'),
103
- global.__WWW__ || global.__XPLAT__
122
+ global.__WWW__ || global.__XPLAT__,
123
+ global.__DEV__
124
);
125
return jest.requireActual(resolvedEntryPoint);
126
});
218
mockAllConfigs(rendererInfo);
219
const resolvedEntryPoint = resolveEntryFork(
220
require.resolve(entryPoint),
201
- global.__WWW__ || global.__XPLAT__
221
+ global.__WWW__ || global.__XPLAT__,
222
+ global.__DEV__
223
);
224
return jest.requireActual(resolvedEntryPoint);
225
});