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.
This commit is contained in:
Dan Stillman 2019-11-08 03:02:59 -05:00
parent 046637d76b
commit 963329df28

View file

@ -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');