From f361f99f531d210019a4ee9b3efc5660b09cc2d9 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Mon, 21 Mar 2016 12:31:52 -0700 Subject: [PATCH] Add sourcemap support for asset-based random access bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary:This adds support for source maps that can be used for “random access modules” / “unbundles” - source maps contain an extra custom field: `x_facebook_offsets` - this field maps module IDs to line offsets - the source map is built as if all files were concatenated Decoding/symbolication works as follows: - when decoding a stack trace, and a stack frame comes from a filename that contains only numbers and ends with `.js`, look up the additionally needed line offset in the offset map and add it to the original line of the stack frame. - consume the source map as usual Reviewed By: martinbigio Differential Revision: D3072426 fb-gh-sync-id: 827e6dc13b1959f02903baafa7f9e4fc2e0d4bb9 shipit-source-id: 827e6dc13b1959f02903baafa7f9e4fc2e0d4bb9 --- react-packager/src/Bundler/Bundle.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/react-packager/src/Bundler/Bundle.js b/react-packager/src/Bundler/Bundle.js index af265ebb..febac2db 100644 --- a/react-packager/src/Bundler/Bundle.js +++ b/react-packager/src/Bundler/Bundle.js @@ -115,9 +115,7 @@ class Bundle extends BundleBase { return { startupCode, - modules: modules.map(({name, code, polyfill}) => - ({name, code, polyfill}) - ), + startupModules: allModules, modules, }; }