Skip to content

spelling mistake in "webpack/examples/multiple-commons-chunks/" leads to a big misunderstanding #2599

@wind-stone

Description

@wind-stone

In the examples "webpack/examples/multiple-commons-chunks/", the current config in webpack.config.js has one spelling mistake, as seen below:

    new CommonsChunkPlugin({
        name: "admin-commons",
        chunks: ["adminPageA", "adminPageB"]
    }),
    new CommonsChunkPlugin({
        name: "commons",
        chunks: ["pageA", "pageB", "admin-commons.js"],
        minChunks: 2
    }),
    new CommonsChunkPlugin({
        name: "c-commons",
        chunks: ["pageC", "adminPageC"]
    }),

we should change "admin-commons.js" to "admin-commons" in the second CommonsChunkPlugin option,

if it is "admin-commons.js", the bundle named "admin-commons" will contain two module, "./modules/admin" and "./modules/a-b-c";

but if it is "admin-commons", the bundle named "admin-commons" will just contain one module -- "./modules/admin".

This lead to a entirely different result , which take me about two days to understand the way how webpack bundles commons chunk..So please correct it~~~thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions