mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
BREAKING: Bump metro-bundler to v0.21.0
Summary: `metro-bundler` v0.21 contains a rewritten bundling mechanism, with simplified logic and much faster rebuild times, called delta bundler. This release contains a couple of breaking changes: * Now, when using a custom transformer, the list of additional babel plugins to apply are passed to the `transform()` method. These are used in non-dev mode for optimization purposes (Check367a5f5db8 (diff-40653f0c822ac59a5af13d5b4ab31d84)to see how to handle them from the transformer). * Now, when using a custom transformer outputting `rawMappings`, the transformer does not need to call the `compactMappings` method before returning (checkd74685fd1d (diff-40653f0c822ac59a5af13d5b4ab31d84)for more info). * We've removed support for two config parameters: `postProcessModules` and `postProcessBundleSourcemap`. Reviewed By: davidaurelio Differential Revision: D6186035 fbshipit-source-id: 242c5c2a954c6b9b6f339d345f888eaa44704579
This commit is contained in:
committed by
Facebook Github Bot
parent
963c61d4d5
commit
0bbd9f042a
@@ -17,12 +17,15 @@ require('../../setupBabel')();
|
||||
* found when Flow v0.54 was deployed. To see the error delete this comment and
|
||||
* run Flow. */
|
||||
const ReactPackager = require('metro-bundler');
|
||||
|
||||
const HmrServer = require('metro-bundler/src/HmrServer');
|
||||
|
||||
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
|
||||
* found when Flow v0.54 was deployed. To see the error delete this comment and
|
||||
* run Flow. */
|
||||
const Terminal = require('metro-bundler/src/lib/Terminal');
|
||||
|
||||
const attachHMRServer = require('./util/attachHMRServer');
|
||||
const attachWebsocketServer = require('./util/attachWebsocketServer');
|
||||
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
|
||||
* found when Flow v0.54 was deployed. To see the error delete this comment and
|
||||
* run Flow. */
|
||||
@@ -131,10 +134,10 @@ function runServer(
|
||||
: http.createServer(app);
|
||||
|
||||
serverInstance.listen(args.port, args.host, 511, function() {
|
||||
attachHMRServer({
|
||||
attachWebsocketServer({
|
||||
httpServer: serverInstance,
|
||||
path: '/hot',
|
||||
packagerServer,
|
||||
websocketServer: new HmrServer(packagerServer, reporter),
|
||||
});
|
||||
|
||||
wsProxy = webSocketProxy.attachToServer(serverInstance, '/debugger-proxy');
|
||||
@@ -200,7 +203,6 @@ function getPackagerServer(args, config, reporter) {
|
||||
sourceExts: defaultSourceExts.concat(args.sourceExts),
|
||||
transformModulePath: transformModulePath,
|
||||
transformCache: TransformCaching.useTempDir(),
|
||||
useDeltaBundler: false,
|
||||
verbose: args.verbose,
|
||||
watch: !args.nonPersistent,
|
||||
workerPath: config.getWorkerPath(),
|
||||
|
||||
Reference in New Issue
Block a user