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

split chunks for async chunk doesn't work #6696

Closed
lili21 opened this issue Mar 7, 2018 · 2 comments · Fixed by #6697
Closed

split chunks for async chunk doesn't work #6696

lili21 opened this issue Mar 7, 2018 · 2 comments · Fixed by #6697
Milestone

Comments

@lili21
Copy link

lili21 commented Mar 7, 2018

Do you want to request a feature or report a bug?
bug

What is the current behavior?
there's no async-vendors chunk.

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

reproduce repo

What is the expected behavior?
async-vendors chunk should be generated.

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.

Node: v9.3.0
webpack: v4.1.0
OS: macOS 10.13.1

webpack config

module.exports = {
  mode: 'production',
  output: {
    filename: '[name].[chunkhash].js',
    chunkFilename: '[name].[chunkhash].js'
  },
  optimization: {
    splitChunks: {
      cacheGroups: {
        vendors: {
          test: /[\\/]node_modules[\\/]/,
          chunks: 'initial',
          priority: -10,
          name: 'vendors',
        },
        'async-vendors': {
          test: /[\\/]node_modules[\\/]/,
          minChunks: 2,
          chunks: 'async',
          priority: 0,
          name: 'async-vendors'
        }
      }
    },
    runtimeChunk: true,
    namedModules: true,
    namedChunks: true
  }
}
@montogeek
Copy link
Member

Thanks for the report!

@lili21
Copy link
Author

lili21 commented Mar 8, 2018

That was fast. 💯

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