From 963329df28d8014e5914a51e93b6fd6224efc49d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 8 Nov 2019 03:02:59 -0500 Subject: [PATCH] Set 'react' and 'react-dom' as externals for browserify When browserifying anything that depends on React, don't bundle another copy of React in the file. There might be some other common dependencies that we should include here. --- scripts/browserify.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/browserify.js b/scripts/browserify.js index 9328e36d81..3cd1a278b7 100644 --- a/scripts/browserify.js +++ b/scripts/browserify.js @@ -39,7 +39,11 @@ async function getBrowserify(signatures) { bundleFs .on('error', reject) .on('finish', resolve); - browserify(f, config.config).bundle().pipe(bundleFs); + browserify(f, config.config) + .external('react') + .external('react-dom') + .bundle() + .pipe(bundleFs); }); onProgress(f, dest, 'browserify');