Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown filename with some different configuration in optimization.splitChunks #9722

Closed
geekxue opened this issue Sep 22, 2019 · 2 comments · Fixed by #9728
Closed

unknown filename with some different configuration in optimization.splitChunks #9722

geekxue opened this issue Sep 22, 2019 · 2 comments · Fixed by #9728

Comments

@geekxue
Copy link

geekxue commented Sep 22, 2019

Bug report

The configuration of optimization.splitChunks is

optimization: {
        usedExports:true,
        splitChunks: {
            chunks: "all",
            cacheGroups: {
                test:/[\\/]node_modules[\\/]/,
            }
        }
    },

What is the current behavior?
It works and bundle the chunk with the name "test~lodash.chunk.js"

If the current behavior is a bug, please provide the steps to reproduce.

The office website about SplitChunksPlugin tells us that "splitChunks.cacheGroups.{cacheGroup}.test" controls which modules are selected by this cache group. It only chooses modules but not defines the name of chunk

What is the expected behavior?
If the code with such configuration should bundle the chunk with the name "vendors~lodash.chunk.js"

Other relevant information:
webpack version: 4.31.0
Node.js version: v10.15.1
Operating System: Mac OS 10.14.6
Additional tools:

@sokra
Copy link
Member

sokra commented Sep 23, 2019

     optimization: {
         usedExports:true,
         splitChunks: {
             chunks: "all",
             cacheGroups: {
+                vendors: {
                     test:/[\\/]node_modules[\\/]/,
+                }
             }
         }
     },

@alexander-akait
Copy link
Member

@sokra maybe we can improve schema?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants