From 2e3f36a525a33484ded7f993ed8155dccaa6f7e7 Mon Sep 17 00:00:00 2001 From: Julien Gilli Date: Fri, 7 Aug 2020 13:43:48 -0700 Subject: [PATCH] provide profiling bundle for react-reconciler --- scripts/rollup/bundles.js | 2 +- scripts/rollup/wrappers.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/rollup/bundles.js b/scripts/rollup/bundles.js index 328fb4c626cb7..baf93fd578155 100644 --- a/scripts/rollup/bundles.js +++ b/scripts/rollup/bundles.js @@ -488,7 +488,7 @@ const bundles = [ /******* React Reconciler *******/ { - bundleTypes: [NODE_DEV, NODE_PROD], + bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING], moduleType: RECONCILER, entry: 'react-reconciler', global: 'ReactReconciler', diff --git a/scripts/rollup/wrappers.js b/scripts/rollup/wrappers.js index 7b36b7388d1da..2c878c616a327 100644 --- a/scripts/rollup/wrappers.js +++ b/scripts/rollup/wrappers.js @@ -292,6 +292,20 @@ module.exports = function $$$reconciler($$$hostConfig) { var exports = {}; ${source} return exports; +};`; + }, + + /***************** NODE_PROFILING (reconciler only) *****************/ + [NODE_PROFILING](source, globalName, filename, moduleType) { + return `/** @license React v${reactVersion} + * ${filename} + * +${license} + */ +module.exports = function $$$reconciler($$$hostConfig) { + var exports = {}; +${source} + return exports; };`; }, };