Skip to content

Question: Multiple JS chunks, single CSS chunk #52

Closed
@AvraamMavridis

Description

@AvraamMavridis

Is it possible to have multiple JS chunks but a single css output file?

My current setup is:

  optimization: {
    minimize: true,
    minimizer: [
      new UglifyJSPlugin({
        uglifyOptions: {
          compress: {
            passes: 2,
          },
          output: {
            comments: false,
          },
        },
      }),
    ],
    splitChunks: {
      chunks: 'all',
      cacheGroups: {
        vendor: {
          filename: 'vendorbundle.js',
          test: m => /node_modules/.test(m.context),
        },
      },
    },
  },

...
...

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

This generates 2 JS files, and 2 css files (styles.css, and 1.styles.css)

What I would like to have is a single css file, is that doable?

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