Skip to content

"Extracting all CSS in a single file" does not work when using a vendor cache group #224

Closed
@jeffijoe

Description

@jeffijoe

This is my cache group config. I'm after

        cacheGroups: {
          default: false,
          vendors: false,
          vendor: {
            test: /[\\/]node_modules[\\/]/,
            name: 'vendor',
            chunks: 'all',
            enforce: true
          },
          styles: {
            name: 'bundle',
            test: /\.css$/,
            chunks: 'all',
            priority: 1000,
            enforce: true
          }
        }

Plugin:

new MiniCssExtractPlugin({ filename: 'bundle.css' }),

The result is 2 files, bundle.css and 1.bundle.css. If I remove the vendor group, I only get bundle.css which is what I want, but in doing so I end up with a single JS file which is not optimal.

I'd like a single bundle.css while keeping separate vendor.js and app.js. 😄

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions