mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Patched up react-devtools-core Webpack configs
This commit is contained in:
+32
-28
@@ -189,34 +189,38 @@ export function connectToDevTools(options: ?ConnectOptions) {
|
||||
}
|
||||
};
|
||||
|
||||
Object.defineProperty(
|
||||
hook,
|
||||
'resolveRNStyle',
|
||||
({
|
||||
enumerable: false,
|
||||
get() {
|
||||
return lazyResolveRNStyle;
|
||||
},
|
||||
set(value) {
|
||||
lazyResolveRNStyle = value;
|
||||
initAfterTick();
|
||||
},
|
||||
}: Object),
|
||||
);
|
||||
Object.defineProperty(
|
||||
hook,
|
||||
'nativeStyleEditorValidAttributes',
|
||||
({
|
||||
enumerable: false,
|
||||
get() {
|
||||
return lazyNativeStyleEditorValidAttributes;
|
||||
},
|
||||
set(value) {
|
||||
lazyNativeStyleEditorValidAttributes = value;
|
||||
initAfterTick();
|
||||
},
|
||||
}: Object),
|
||||
);
|
||||
if (!hook.hasOwnProperty('resolveRNStyle')) {
|
||||
Object.defineProperty(
|
||||
hook,
|
||||
'resolveRNStyle',
|
||||
({
|
||||
enumerable: false,
|
||||
get() {
|
||||
return lazyResolveRNStyle;
|
||||
},
|
||||
set(value) {
|
||||
lazyResolveRNStyle = value;
|
||||
initAfterTick();
|
||||
},
|
||||
}: Object),
|
||||
);
|
||||
}
|
||||
if (!hook.hasOwnProperty('nativeStyleEditorValidAttributes')) {
|
||||
Object.defineProperty(
|
||||
hook,
|
||||
'nativeStyleEditorValidAttributes',
|
||||
({
|
||||
enumerable: false,
|
||||
get() {
|
||||
return lazyNativeStyleEditorValidAttributes;
|
||||
},
|
||||
set(value) {
|
||||
lazyNativeStyleEditorValidAttributes = value;
|
||||
initAfterTick();
|
||||
},
|
||||
}: Object),
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ if (!NODE_ENV) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const builtModulesDir = resolve(__dirname, '..', '..', 'build', 'node_modules');
|
||||
|
||||
const __DEV__ = NODE_ENV === 'development';
|
||||
|
||||
const GITHUB_URL = getGitHubURL();
|
||||
@@ -30,6 +32,15 @@ module.exports = {
|
||||
library: 'ReactDevToolsBackend',
|
||||
libraryTarget: 'umd',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
react: resolve(builtModulesDir, 'react'),
|
||||
'react-dom': resolve(builtModulesDir, 'react-dom'),
|
||||
'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'),
|
||||
'react-is': resolve(builtModulesDir, 'react-is'),
|
||||
scheduler: resolve(builtModulesDir, 'scheduler'),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
new DefinePlugin({
|
||||
__DEV__: true,
|
||||
|
||||
@@ -11,6 +11,8 @@ if (!NODE_ENV) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const builtModulesDir = resolve(__dirname, '..', '..', 'build', 'node_modules');
|
||||
|
||||
const __DEV__ = NODE_ENV === 'development';
|
||||
|
||||
const GITHUB_URL = getGitHubURL();
|
||||
@@ -29,6 +31,15 @@ module.exports = {
|
||||
library: '[name]',
|
||||
libraryTarget: 'commonjs2',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
react: resolve(builtModulesDir, 'react'),
|
||||
'react-dom': resolve(builtModulesDir, 'react-dom'),
|
||||
'react-debug-tools': resolve(builtModulesDir, 'react-debug-tools'),
|
||||
'react-is': resolve(builtModulesDir, 'react-is'),
|
||||
scheduler: resolve(builtModulesDir, 'scheduler'),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
new DefinePlugin({
|
||||
__DEV__: false,
|
||||
|
||||
@@ -92,7 +92,7 @@ By default DevTools listen to port `8097` on `localhost`. If you need to customi
|
||||
|
||||
## Developing
|
||||
|
||||
* Run `yarn run backend:watch` and `yarn run standalone:watch` in `../react-devtools-core`
|
||||
* Run `yarn start:backend` and `yarn start:standalone` in `../react-devtools-core`
|
||||
* Run `yarn start` in this folder
|
||||
* Refresh the app after it has recompiled a change
|
||||
* For React Native, copy `react-devtools-core` to its `node_modules` to test your changes.
|
||||
Reference in New Issue
Block a user