<p dir="auto">I migrate from webpack from 1.x to latest 2.3.1, when I start, always show module.entry is invalid.</p>
<p dir="auto">my webpack config as follwing， I did not see any issue in the config.</p>
<p dir="auto">var webpack            = require('webpack');<br>
var autoprefixer       = require('autoprefixer');<br>
var path               = require('path');<br>
var config             = require('config')<br>
var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');</p>
<p dir="auto">module.exports = {<br>
resolve: {<br>
extensions: ['.js', '.ts', '.tsx', '.js'],<br>
modules: ['node_modules'],<br>
alias: {<br>
bower: path.resolve(__dirname, 'ui/bower_components'),<br>
"matches-selector/matches-selector": "desandro-matches-selector",<br>
"eventEmitter/EventEmitter": "wolfy87-eventemitter",<br>
"get-style-property/get-style-property": "desandro-get-style-property"<br>
}<br>
},</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="entry: {
    app: path.resolve(__dirname, 'ui/app/index.ts')
    'app.vendor': './ui/editor/app.index.ts',
    home: './ui/home/index.ts',
    'home.vendor': './ui/home/vendor.index.ts',
},

output: {
    path: path.resolve(__dirname, 'ui/build'),
    pathinfo: true,
    publicPath: config.uiServer.protocol + config.uiServer.host + ':' + config.uiServer.port + '/build/',
    filename: '[name].js'
},

devServer: {
    contentBase: './ui'
},

module: {
    rules: [
        {
            test: /\-template\.(|html|js)$/,
            use: ['raw']
        }, {
            test: /\.css$/,
            loader: &quot;style!css&quot;
        }, {
            test: /\.scss$/,
            include: [/node_modules/, /bower_components/],
            use: [{
                loader: &quot;style-loader&quot; // creates style nodes from JS strings
            }, {
                loader: &quot;css-loader&quot; // translates CSS into CommonJS
            }, {
                loader: &quot;sass-loader&quot; // compiles Sass to CSS
            }]
        }, {
            test: /\.scss$/,
            exclude: [/node_modules/, /bower_components/],
            use: [{
                loader: &quot;style-loader&quot;
            }, {
                loader: &quot;css-loader&quot;, options: {
                    sourceMap: true
                }
            }, {
                loader: &quot;sass-loader&quot;, options: {
                    sourceMap: true
                }
            }]
        }, {
            test: /\.tsx?$/, 
            use: ['ts-loader']
        }, {
            test: /\.coffee$/,
            use: [&quot;coffee&quot;]
        }, {
            test: /\.json$/,
            use: [&quot;json&quot;]
        }, {
            test: /\.pug$/,
            use: [&quot;ngtemplate?relativeTo=&quot; + __dirname + &quot;!raw!pug-html?basedir=&quot; + __dirname]
        }, {
            test: /\.png$/,
            use: ['url-loader?limit=8192'],
            query: { mimetype: &quot;image/png&quot; }
        }, {
            test: /\.jpg$/,
            use: ['url-loader?limit=8192&amp;mimetype=image/jpg'],
            query: { mimetype: &quot;image/jpg&quot; }
        }, {
            test: /\.gif$/,
            use: ['url-loader?limit=8192&amp;mimetype=image/gif'],
            query: { mimetype: &quot;image/gif&quot; }
        }, {
            test: /\.webp$/,
            use: ['url-loader?limit=8192&amp;mimetype=image/webp'],
            query: { mimetype: &quot;image/webp&quot; }
        }, {
            test: /\.swf$/,
            use: ['url-loader?mimetype=application/x-shockwave-flash'],
            query: { mimetype: &quot;application/x-shockwave-flash&quot; }
        },
        // Added for bootstrap-css-loader
        {
            test: /bootstrap.*\/javascripts\//,
            use: ['imports?jQuery=jquery']
        }, {
            test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
            use: [&quot;url?limit=10000&amp;mimetype=application/font-woff&quot;]
        }, {
            test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
            use: [&quot;url?limit=10000&amp;mimetype=application/font-woff&quot;]
        }, {
            test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
            use: [&quot;url?limit=10000&amp;mimetype=application/octet-stream&quot;]
        }, {
            test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
            use: [&quot;file&quot;]
        }, {
            test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
            use: [&quot;url?limit=10000&amp;mimetype=image/svg+xml&quot;]
        }
    ],

    noParse: [
        /bower_components/
    ]
},

plugins: [
    new CommonsChunkPlugin({
        name: 'app.vendor',
        chunks: ['app', 'app.vendor']
    }),
    new CommonsChunkPlugin({
        name: 'home.vendor',
        chunks: ['home', 'home.vendor']
    }),
    new webpack.SourceMapDevToolPlugin({
        exclude: /.*\.vendor\.js/,
        columns: false,
        module: true
    }),
    new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        &quot;window.jQuery&quot;: 'jquery',
        '_': 'lodash',
        i18next: 'i18next'
    }),
],"><pre class="notranslate"><code class="notranslate">entry: {
    app: path.resolve(__dirname, 'ui/app/index.ts')
    'app.vendor': './ui/editor/app.index.ts',
    home: './ui/home/index.ts',
    'home.vendor': './ui/home/vendor.index.ts',
},

output: {
    path: path.resolve(__dirname, 'ui/build'),
    pathinfo: true,
    publicPath: config.uiServer.protocol + config.uiServer.host + ':' + config.uiServer.port + '/build/',
    filename: '[name].js'
},

devServer: {
    contentBase: './ui'
},

module: {
    rules: [
        {
            test: /\-template\.(|html|js)$/,
            use: ['raw']
        }, {
            test: /\.css$/,
            loader: "style!css"
        }, {
            test: /\.scss$/,
            include: [/node_modules/, /bower_components/],
            use: [{
                loader: "style-loader" // creates style nodes from JS strings
            }, {
                loader: "css-loader" // translates CSS into CommonJS
            }, {
                loader: "sass-loader" // compiles Sass to CSS
            }]
        }, {
            test: /\.scss$/,
            exclude: [/node_modules/, /bower_components/],
            use: [{
                loader: "style-loader"
            }, {
                loader: "css-loader", options: {
                    sourceMap: true
                }
            }, {
                loader: "sass-loader", options: {
                    sourceMap: true
                }
            }]
        }, {
            test: /\.tsx?$/, 
            use: ['ts-loader']
        }, {
            test: /\.coffee$/,
            use: ["coffee"]
        }, {
            test: /\.json$/,
            use: ["json"]
        }, {
            test: /\.pug$/,
            use: ["ngtemplate?relativeTo=" + __dirname + "!raw!pug-html?basedir=" + __dirname]
        }, {
            test: /\.png$/,
            use: ['url-loader?limit=8192'],
            query: { mimetype: "image/png" }
        }, {
            test: /\.jpg$/,
            use: ['url-loader?limit=8192&amp;mimetype=image/jpg'],
            query: { mimetype: "image/jpg" }
        }, {
            test: /\.gif$/,
            use: ['url-loader?limit=8192&amp;mimetype=image/gif'],
            query: { mimetype: "image/gif" }
        }, {
            test: /\.webp$/,
            use: ['url-loader?limit=8192&amp;mimetype=image/webp'],
            query: { mimetype: "image/webp" }
        }, {
            test: /\.swf$/,
            use: ['url-loader?mimetype=application/x-shockwave-flash'],
            query: { mimetype: "application/x-shockwave-flash" }
        },
        // Added for bootstrap-css-loader
        {
            test: /bootstrap.*\/javascripts\//,
            use: ['imports?jQuery=jquery']
        }, {
            test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
            use: ["url?limit=10000&amp;mimetype=application/font-woff"]
        }, {
            test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
            use: ["url?limit=10000&amp;mimetype=application/font-woff"]
        }, {
            test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
            use: ["url?limit=10000&amp;mimetype=application/octet-stream"]
        }, {
            test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
            use: ["file"]
        }, {
            test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
            use: ["url?limit=10000&amp;mimetype=image/svg+xml"]
        }
    ],

    noParse: [
        /bower_components/
    ]
},

plugins: [
    new CommonsChunkPlugin({
        name: 'app.vendor',
        chunks: ['app', 'app.vendor']
    }),
    new CommonsChunkPlugin({
        name: 'home.vendor',
        chunks: ['home', 'home.vendor']
    }),
    new webpack.SourceMapDevToolPlugin({
        exclude: /.*\.vendor\.js/,
        columns: false,
        module: true
    }),
    new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        "window.jQuery": 'jquery',
        '_': 'lodash',
        i18next: 'i18next'
    }),
],
</code></pre></div>
<p dir="auto">};</p>
<p dir="auto">the error message as following:<br>
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.</p>
<ul dir="auto">
<li>configuration.entry should be one of these:<br>
object { : non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function<br>
The entry point(s) of the compilation.<br>
Details:
<ul dir="auto">
<li>configuration.entry['home'] should be a string.</li>
<li>configuration.entry['home'] should NOT have duplicate items (items ## 1 and 3 are identical) ({<br>
"keyword": "uniqueItems",<br>
"dataPath": ".entry['home']",<br>
"schemaPath": "#/definitions/common.nonEmptyArrayOfUniqueStringValues/uniqueItems",<br>
"params": {<br>
"i": 3,<br>
"j": 1<br>
},<br>
"message": "should NOT have duplicate items (items ## 1 and 3 are identical)",<br>
"schema": true,<br>
"parentSchema": {<br>
"items": {<br>
"minLength": 1,<br>
"type": "string"<br>
},<br>
"minItems": 1,<br>
"type": "array",<br>
"uniqueItems": true<br>
},<br>
"data": [<br>
"/usr/local/lib/node_modules/webpack-dev-server/client/index.js?http://0.0.0.0:4000",<br>
"webpack/hot/dev-server",<br>
"/Users/yishuihanxiao/ws/ror/University_Work/node_modules/webpack-dev-server/client/index.js?http://0.0.0.0:4000",<br>
"webpack/hot/dev-server",<br>
"./ui/home/index.ts"<br>
]<br>
}).<br>
[non-empty string]</li>
<li>configuration.entry['home'] should be one of these:<br>
non-empty string | [non-empty string]</li>
<li>configuration.entry should be a string.</li>
<li>configuration.entry should be an array:<br>
[non-empty string]</li>
<li>configuration.entry should be an instance of function<br>
function returning an entry object or a promise..</li>
</ul>
</li>
</ul>
<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">If we have two modules say A and B. A and B imports react.<br>
During dynamic import of these two module I found react code to be duplicated.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">This is the <a href="https://github.com/nikhilnayyar002/react-min">repo link</a>.</p>
<p dir="auto">This is the source and public.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/38173563/125198276-e45d2b80-e27e-11eb-8d10-31077b1b7964.png"><img src="https://user-images.githubusercontent.com/38173563/125198276-e45d2b80-e27e-11eb-8d10-31077b1b7964.png" alt="image" style="max-width: 100%;"></a></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//src/index.js
import &quot;@styles/index.css&quot;;
import &quot;jquery/dist/jquery.slim&quot;

import(/* webpackExports: [&quot;default&quot;] */&quot;./app&quot;).then(({default:App})=&gt;{
    import(/* webpackExports: [&quot;default&quot;] */&quot;./app2&quot;).then(({default:render})=&gt;{
        render(App)
    })
})"><pre class="notranslate"><span class="pl-c">//src/index.js</span>
<span class="pl-k">import</span> <span class="pl-s">"@styles/index.css"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s">"jquery/dist/jquery.slim"</span>

<span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-c">/* webpackExports: ["default"] */</span><span class="pl-s">"./app"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">default</span>:<span class="pl-v">App</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span>
    <span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-c">/* webpackExports: ["default"] */</span><span class="pl-s">"./app2"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">default</span>:<span class="pl-s1">render</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span>
        <span class="pl-s1">render</span><span class="pl-kos">(</span><span class="pl-v">App</span><span class="pl-kos">)</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//src/app.js
import { Modal } from 'bootstrap';
import{ useEffect, useState } from 'react';

export default function App() {
    const [state] = useState(Date.now())

    useEffect(()=&gt;{
        if(document.getElementById(&quot;myModal&quot;)) {
            let elem = document.getElementById(&quot;myModal&quot;)
            let modal = new Modal(elem)
            modal.hide()
        }
    },[])

    return (
        &lt;div&gt;
            &lt;div&gt;Hello WORLD&lt;/div&gt;
            &lt;div&gt;{state}&lt;/div&gt;
        &lt;/div&gt;
    )
}"><pre class="notranslate"><span class="pl-c">//src/app.js</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">Modal</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'bootstrap'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span><span class="pl-kos">{</span> <span class="pl-s1">useEffect</span><span class="pl-kos">,</span> <span class="pl-s1">useState</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-v">App</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-kos">[</span><span class="pl-s1">state</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-en">useState</span><span class="pl-kos">(</span><span class="pl-v">Date</span><span class="pl-kos">.</span><span class="pl-en">now</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>

    <span class="pl-en">useEffect</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span>
        <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">"myModal"</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">let</span> <span class="pl-s1">elem</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">"myModal"</span><span class="pl-kos">)</span>
            <span class="pl-k">let</span> <span class="pl-s1">modal</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Modal</span><span class="pl-kos">(</span><span class="pl-s1">elem</span><span class="pl-kos">)</span>
            <span class="pl-s1">modal</span><span class="pl-kos">.</span><span class="pl-en">hide</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span>

    <span class="pl-k">return</span> <span class="pl-kos">(</span>
        <span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span>
            <span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span>Hello WORLD<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span>
            <span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-s1">state</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span>
        <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span>
    <span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//src/app2.js
import React from 'react';
import ReactDOM from 'react-dom';

export default function render(App) {
    ReactDOM.render(
        &lt;React.StrictMode&gt;
            &lt;App /&gt;
        &lt;/React.StrictMode&gt;,
        document.getElementById('root')
    );
}"><pre class="notranslate"><span class="pl-c">//src/app2.js</span>
<span class="pl-k">import</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-v">ReactDOM</span> <span class="pl-k">from</span> <span class="pl-s">'react-dom'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span> <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-v">App</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-v">ReactDOM</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span>
        <span class="pl-c1">&lt;</span><span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-v">StrictMode</span><span class="pl-c1">&gt;</span>
            <span class="pl-c1">&lt;</span><span class="pl-v">App</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
        <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-v">StrictMode</span><span class="pl-c1">&gt;</span><span class="pl-kos">,</span>
        <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">'root'</span><span class="pl-kos">)</span>
    <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//webpack.prod.js
    mode: 'production',
    output: {
        filename: '[name].[contenthash].js',
        chunkFilename:'[id].[contenthash].js',
    },
    plugins: [ ... ],
    optimization: {
        minimize: true,
        minimizer: [
            new TerserPlugin({
                extractComments: false,
            }),
            new CssMinimizerPlugin()
        ],
        moduleIds: 'deterministic',
        runtimeChunk: 'single',
        splitChunks: {
            chunks: 'all',
            cacheGroups: {
                vendorsInitial: {
                    test: /[\\/]node_modules[\\/]/,
                    chunks: 'initial',
                },
                vendorsAsync: {
                    test: /[\\/]node_modules[\\/]/,
                    chunks: 'async',
                },"><pre class="notranslate"><span class="pl-c">//webpack.prod.js</span>
    <span class="pl-s1">mode</span>: <span class="pl-s">'production'</span><span class="pl-kos">,</span>
    <span class="pl-s1">output</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">filename</span>: <span class="pl-s">'[name].[contenthash].js'</span><span class="pl-kos">,</span>
        <span class="pl-c1">chunkFilename</span>:<span class="pl-s">'[id].[contenthash].js'</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-s1">plugins</span>: <span class="pl-kos">[</span> ... <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s1">optimization</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">minimize</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-c1">minimizer</span>: <span class="pl-kos">[</span>
            <span class="pl-k">new</span> <span class="pl-v">TerserPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
                <span class="pl-c1">extractComments</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
            <span class="pl-k">new</span> <span class="pl-v">CssMinimizerPlugin</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
        <span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-c1">moduleIds</span>: <span class="pl-s">'deterministic'</span><span class="pl-kos">,</span>
        <span class="pl-c1">runtimeChunk</span>: <span class="pl-s">'single'</span><span class="pl-kos">,</span>
        <span class="pl-c1">splitChunks</span>: <span class="pl-kos">{</span>
            <span class="pl-c1">chunks</span>: <span class="pl-s">'all'</span><span class="pl-kos">,</span>
            <span class="pl-c1">cacheGroups</span>: <span class="pl-kos">{</span>
                <span class="pl-c1">vendorsInitial</span>: <span class="pl-kos">{</span>
                    <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span>node_modules<span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                    <span class="pl-c1">chunks</span>: <span class="pl-s">'initial'</span><span class="pl-kos">,</span>
                <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-c1">vendorsAsync</span>: <span class="pl-kos">{</span>
                    <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span>node_modules<span class="pl-kos">[</span><span class="pl-cce">\\</span>/<span class="pl-kos">]</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
                    <span class="pl-c1">chunks</span>: <span class="pl-s">'async'</span><span class="pl-kos">,</span>
                <span class="pl-kos">}</span><span class="pl-kos">,</span></pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm ci
npm run build"><pre class="notranslate">npm ci
npm run build</pre></div>
<p dir="auto">These are the build assets:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="310.3f191f82792ae2cafdf4.js
589.7d374a5468098e334db1.js
598.dccce690a646df0467cb.js
601.05cbbc0a1fa75c999014.js
70.af0523773e96dec9c092.js
favicon.ico
index.html
main.099275078be1d62b3b50.css
main.aa06ebf00a2dc10cbae3.js
runtime.fd41db16facc83bbd2f9.js"><pre lang="text" class="notranslate"><code class="notranslate">310.3f191f82792ae2cafdf4.js
589.7d374a5468098e334db1.js
598.dccce690a646df0467cb.js
601.05cbbc0a1fa75c999014.js
70.af0523773e96dec9c092.js
favicon.ico
index.html
main.099275078be1d62b3b50.css
main.aa06ebf00a2dc10cbae3.js
runtime.fd41db16facc83bbd2f9.js
</code></pre></div>
<ul dir="auto">
<li><strong>index.html</strong></li>
</ul>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot; /&gt;
    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1&quot; /&gt;
    &lt;title&gt;React Min&lt;/title&gt;
    &lt;link rel=&quot;icon&quot; href=&quot;/favicon.ico&quot; /&gt;
    &lt;link href=&quot;/main.099275078be1d62b3b50.css&quot; rel=&quot;stylesheet&quot; /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;root&quot;&gt;&lt;/div&gt;
    &lt;script defer=&quot;defer&quot; src=&quot;/runtime.fd41db16facc83bbd2f9.js&quot;&gt;&lt;/script&gt;
    &lt;script defer=&quot;defer&quot; src=&quot;/70.af0523773e96dec9c092.js&quot;&gt;&lt;/script&gt;
    &lt;script defer=&quot;defer&quot; src=&quot;/main.aa06ebf00a2dc10cbae3.js&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;"><pre class="notranslate"><span class="pl-c1">&lt;!DOCTYPE html<span class="pl-kos">&gt;</span></span>
<span class="pl-kos">&lt;</span><span class="pl-ent">html</span> <span class="pl-c1">lang</span>="<span class="pl-s">en</span>"<span class="pl-kos">&gt;</span>
  <span class="pl-kos">&lt;</span><span class="pl-ent">head</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">meta</span> <span class="pl-c1">charset</span>="<span class="pl-s">UTF-8</span>" /&gt;
    <span class="pl-kos">&lt;</span><span class="pl-ent">meta</span> <span class="pl-c1">http-equiv</span>="<span class="pl-s">X-UA-Compatible</span>" <span class="pl-c1">content</span>="<span class="pl-s">IE=edge</span>" /&gt;
    <span class="pl-kos">&lt;</span><span class="pl-ent">meta</span> <span class="pl-c1">name</span>="<span class="pl-s">viewport</span>" <span class="pl-c1">content</span>="<span class="pl-s">width=device-width,initial-scale=1</span>" /&gt;
    <span class="pl-kos">&lt;</span><span class="pl-ent">title</span><span class="pl-kos">&gt;</span>React Min<span class="pl-kos">&lt;/</span><span class="pl-ent">title</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">link</span> <span class="pl-c1">rel</span>="<span class="pl-s">icon</span>" <span class="pl-c1">href</span>="<span class="pl-s">/favicon.ico</span>" /&gt;
    <span class="pl-kos">&lt;</span><span class="pl-ent">link</span> <span class="pl-c1">href</span>="<span class="pl-s">/main.099275078be1d62b3b50.css</span>" <span class="pl-c1">rel</span>="<span class="pl-s">stylesheet</span>" /&gt;
  <span class="pl-kos">&lt;/</span><span class="pl-ent">head</span><span class="pl-kos">&gt;</span>
  <span class="pl-kos">&lt;</span><span class="pl-ent">body</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">id</span>="<span class="pl-s">root</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">script</span> <span class="pl-c1">defer</span>="<span class="pl-s">defer</span>" <span class="pl-c1">src</span>="<span class="pl-s">/runtime.fd41db16facc83bbd2f9.js</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">script</span> <span class="pl-c1">defer</span>="<span class="pl-s">defer</span>" <span class="pl-c1">src</span>="<span class="pl-s">/70.af0523773e96dec9c092.js</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
    <span class="pl-kos">&lt;</span><span class="pl-ent">script</span> <span class="pl-c1">defer</span>="<span class="pl-s">defer</span>" <span class="pl-c1">src</span>="<span class="pl-s">/main.aa06ebf00a2dc10cbae3.js</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
  <span class="pl-kos">&lt;/</span><span class="pl-ent">body</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">html</span><span class="pl-kos">&gt;</span></pre></div>
<ul dir="auto">
<li><strong>310.3f191f82792ae2cafdf4.js</strong>: this one is <code class="notranslate">src/app.js</code> chunk</li>
<li><strong>589.7d374a5468098e334db1.js</strong>: node_modules code chunk for  <code class="notranslate">src/app2.js</code> (showing comments only..):</li>
</ul>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
...
/** @license React v17.0.2
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
...
/** @license React v17.0.2
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
...
/** @license React v17.0.2
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
...
/** @license React v0.20.2
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
..."><pre class="notranslate"><span class="pl-c">/*</span>
<span class="pl-c">object-assign</span>
<span class="pl-c">(c) Sindre Sorhus</span>
<span class="pl-c"><span class="pl-k">@license</span> MIT</span>
<span class="pl-c">*/</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v17.0.2</span>
<span class="pl-c"> * react-dom.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v17.0.2</span>
<span class="pl-c"> * react-jsx-runtime.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v17.0.2</span>
<span class="pl-c"> * react.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v0.20.2</span>
<span class="pl-c"> * scheduler.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span>
...</pre></div>
<ul dir="auto">
<li><strong>598.dccce690a646df0467cb.js</strong>: this one is <code class="notranslate">src/app2.js</code> chunk</li>
<li><strong>601.05cbbc0a1fa75c999014.js</strong>: node_modules code chunk for  <code class="notranslate">src/app.js</code> (showing comments only..):</li>
</ul>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...  // &lt;-- popperjs code
/*!
  * Bootstrap v5.0.2 (https://getbootstrap.com/)
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */
...
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
...
/** @license React v17.0.2
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
...
/** @license React v17.0.2
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
..."><pre class="notranslate">...  <span class="pl-c">// &lt;-- popperjs code</span>
<span class="pl-c">/*!</span>
<span class="pl-c">  * Bootstrap v5.0.2 (https://getbootstrap.com/)</span>
<span class="pl-c">  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)</span>
<span class="pl-c">  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)</span>
<span class="pl-c">  */</span>
...
<span class="pl-c">/*</span>
<span class="pl-c">object-assign</span>
<span class="pl-c">(c) Sindre Sorhus</span>
<span class="pl-c"><span class="pl-k">@license</span> MIT</span>
<span class="pl-c">*/</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v17.0.2</span>
<span class="pl-c"> * react-jsx-runtime.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v17.0.2</span>
<span class="pl-c"> * react.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span>
...</pre></div>
<ul dir="auto">
<li><strong>70.af0523773e96dec9c092.js</strong>: this one include jquery code only. Remember we imported jquery in <code class="notranslate">src/index.js</code>. It is a entry module.</li>
<li><strong>main.aa06ebf00a2dc10cbae3.js</strong>:  <code class="notranslate">src/index.js</code> code is included in it. It is a entry module.</li>
<li><strong>runtime.fd41db16facc83bbd2f9.js</strong>: runtime. It is a entry module.</li>
<li><strong>main.099275078be1d62b3b50.css</strong>: style imported inside <code class="notranslate">src/index.js</code> .</li>
<li><strong>favicon.ico</strong></li>
</ul>
<p dir="auto">As one can see these two chunks: <strong>601.05cbbc0a1fa75c999014.js</strong> &amp; <strong>589.7d374a5468098e334db1.js</strong> has code in common:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
...
/** @license React v17.0.2
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
...
/** @license React v17.0.2
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */"><pre class="notranslate"><span class="pl-c">/*</span>
<span class="pl-c">object-assign</span>
<span class="pl-c">(c) Sindre Sorhus</span>
<span class="pl-c"><span class="pl-k">@license</span> MIT</span>
<span class="pl-c">*/</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v17.0.2</span>
<span class="pl-c"> * react-jsx-runtime.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span>
...
<span class="pl-c">/** <span class="pl-k">@license</span> React v17.0.2</span>
<span class="pl-c"> * react.production.min.js</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * Copyright (c) Facebook, Inc. and its affiliates.</span>
<span class="pl-c"> *</span>
<span class="pl-c"> * This source code is licensed under the MIT license found in the</span>
<span class="pl-c"> * LICENSE file in the root directory of this source tree.</span>
<span class="pl-c"> */</span></pre></div>






<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Webpack should be able to check that if it has generated chunk for library say React, Bootstrap, React-dom etc then it should not generate code again if it founds that library has been imported inside a dynamically imported module.</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  ^5.44.0<br>
Node.js version: 14.17.3<br>
Operating System: Windows 10<br>
Additional tools:</p>