<p dir="auto">When I have a structure like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="├─┬ node_modules
│ ├── backbone@1.2.1
│ ├─┬ backbone.marionette@2.4.1  
│ │ └─┬ node_modules
│ │   ├── backbone@1.1.2
│ │   └── backbone.babysitter@0.1.7
│ └── backbone.babysitter@0.1.7
└── app.js"><pre class="notranslate"><code class="notranslate">├─┬ node_modules
│ ├── backbone@1.2.1
│ ├─┬ backbone.marionette@2.4.1  
│ │ └─┬ node_modules
│ │   ├── backbone@1.1.2
│ │   └── backbone.babysitter@0.1.7
│ └── backbone.babysitter@0.1.7
└── app.js
</code></pre></div>
<p dir="auto">And load these modules in my app.js like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Backbone from &quot;backbone&quot;;
import Marionette from &quot;backbone.marionette&quot;;
import &quot;backbone.babysitter&quot;;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">Backbone</span> <span class="pl-k">from</span> <span class="pl-s">"backbone"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-v">Marionette</span> <span class="pl-k">from</span> <span class="pl-s">"backbone.marionette"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s">"backbone.babysitter"</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Now when I watch in dev tools at the sources tab, it show that the page has loaded 2 backbones and 2 backbone.babysitters. First the self defined versions, and secondly the dependencies of Marionette:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6d65814b671bd781ee5fda4e4fb84d2fc2d179f0aa6ed7129fc2a007c23cb723/687474703a2f2f7331332e706f7374696d672e6f72672f6431796176627a79762f7765627061636b5f736f75726365732e706e67"><img src="https://camo.githubusercontent.com/6d65814b671bd781ee5fda4e4fb84d2fc2d179f0aa6ed7129fc2a007c23cb723/687474703a2f2f7331332e706f7374696d672e6f72672f6431796176627a79762f7765627061636b5f736f75726365732e706e67" alt="webpack-sources" data-canonical-src="http://s13.postimg.org/d1yavbzyv/webpack_sources.png" style="max-width: 100%;"></a></p>
<p dir="auto">How can I ensure that webpack provides the self defined packages to Marionette?</p>
<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong><br>
When I have one entry point for a JS file, everything is fine. However, as soon as I add another entry point including a JS file (e.g. LESS file entry points won't change anything), webpack creates a chunk file (like <code class="notranslate">123.bundle.js</code>), even though I set the <code class="notranslate">LimitChunkCountPlugin</code> <code class="notranslate">maxChunks</code> to 1. There are no common modules in these 2 entry points and no async imports.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module.exports = {
    mode: isProd ? 'production' : 'development',

    devServer: {
        publicPath: '/', // webpack bug, should default to '/'
        contentBase: path.join(__dirname, 'build'),
    },

    entry: {
        public: [ src('js/public.js'), src('less/public.less') ],
        video: [ src('less/video.less'), src('js/player.js') ], // adding this js is causing 'public' to code split
        application: src('less/application.less'),
    },

    output: {
        path: path.resolve(__dirname, 'build/'),
        filename: 'js/[name].bundle.js'
    },

    module: {
        rules: [{
            test: /\.js$/,
            exclude: /node_modules/,
            use: {
                loader: 'babel-loader',
                options: { presets: [ [ &quot;@babel/preset-env&quot;, { &quot;useBuiltIns&quot;: &quot;usage&quot;, &quot;corejs&quot;: 3, } ] ] }
            }
        },
        {
            test: /\.less$/,
            use: [
                MiniCssExtractPlugin.loader,
                'css-loader',
                { loader: 'postcss-loader', options: { plugins: () =&gt; isProd ? [autoprefixer(), cssnano()] : [] } },
                'less-loader'
            ]
        },
        { test: /\.eot$/, loader: 'ignore-loader' }
    ]
    },

    plugins: [
        new webpack.optimize.LimitChunkCountPlugin({
            maxChunks: 1
        }),

        new MiniCssExtractPlugin({
            filename: 'css/[name].bundle.css',
            chunkFilename: '[name].css',
        })
    ]
};"><pre class="notranslate"><code class="notranslate">module.exports = {
    mode: isProd ? 'production' : 'development',

    devServer: {
        publicPath: '/', // webpack bug, should default to '/'
        contentBase: path.join(__dirname, 'build'),
    },

    entry: {
        public: [ src('js/public.js'), src('less/public.less') ],
        video: [ src('less/video.less'), src('js/player.js') ], // adding this js is causing 'public' to code split
        application: src('less/application.less'),
    },

    output: {
        path: path.resolve(__dirname, 'build/'),
        filename: 'js/[name].bundle.js'
    },

    module: {
        rules: [{
            test: /\.js$/,
            exclude: /node_modules/,
            use: {
                loader: 'babel-loader',
                options: { presets: [ [ "@babel/preset-env", { "useBuiltIns": "usage", "corejs": 3, } ] ] }
            }
        },
        {
            test: /\.less$/,
            use: [
                MiniCssExtractPlugin.loader,
                'css-loader',
                { loader: 'postcss-loader', options: { plugins: () =&gt; isProd ? [autoprefixer(), cssnano()] : [] } },
                'less-loader'
            ]
        },
        { test: /\.eot$/, loader: 'ignore-loader' }
    ]
    },

    plugins: [
        new webpack.optimize.LimitChunkCountPlugin({
            maxChunks: 1
        }),

        new MiniCssExtractPlugin({
            filename: 'css/[name].bundle.css',
            chunkFilename: '[name].css',
        })
    ]
};
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
It's expected to not create any chunks since maxChunks is set to 1.<br>
Also I would expect it to behave consistently, no matter if I have one or many entry points.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: 5.10.3<br>
Node.js version: v12.15.0<br>
Operating System: Win7</p>