Using React components bundled with Webpack causes duplication of submodules
问题 We have 4 React components bundled with Webpack (version 1): A, B, C and D. The dependency tree looks like this: A B D C D We want each component to be reusable, so we use webpack to generate a UMD module. The generated bundle for each component is located in ./dist/index.js , and the package.json of each component sets this script as the entry point for the library: "main": "./dist/index.js" This is the webpack config file for component A: const webpack = require('webpack'); const