diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index 5cc924a3bd4946..915db17a5975d9 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -10,7 +10,6 @@ const InspectorProxy = require('./util/inspectorProxy.js'); const ReactPackager = require('../../packager/react-packager'); -const TerminalReporter = require('../../packager/src/lib/TerminalReporter'); const attachHMRServer = require('./util/attachHMRServer'); const connect = require('connect'); @@ -86,6 +85,10 @@ function getPackagerServer(args, config) { const providesModuleNodeModules = args.providesModuleNodeModules || defaultProvidesModuleNodeModules; + const LogReporter = args.customLogReporterPath + ? require(path.resolve(args.customLogReporterPath)) + : require('../../packager/src/lib/TerminalReporter'); + return ReactPackager.createServer({ assetExts: defaultAssetExts.concat(args.assetExts), blacklistRE: config.getBlacklistRE(), @@ -96,7 +99,7 @@ function getPackagerServer(args, config) { platforms: defaultPlatforms.concat(args.platforms), projectRoots: args.projectRoots, providesModuleNodeModules: providesModuleNodeModules, - reporter: new TerminalReporter(), + reporter: new LogReporter(), resetCache: args.resetCache, transformModulePath: transformModulePath, verbose: args.verbose, diff --git a/local-cli/server/server.js b/local-cli/server/server.js index 3d72c8d771bf9c..c09bc7c0bb96cd 100644 --- a/local-cli/server/server.js +++ b/local-cli/server/server.js @@ -118,6 +118,9 @@ module.exports = { }, { command: '--reset-cache, --resetCache', description: 'Removes cached files', + }, { + command: '--custom-log-reporter-path, --customLogReporterPath [string]', + description: 'Path to a JavaScript file that exports a log reporter as a replacement for TerminalReporter', }, { command: '--verbose', description: 'Enables logging',