2

I use SplitChunksPlugin to move all vendor JS from vendor/ and node_modules/ folders into a separate file:

splitChunks: {
    cacheGroups: {
        vendor: {
          test: /[\\/](vendor|node_modules)[\\/]/,
          name: 'vendor',
          chunks: 'all'
        }
    }
},

I also use MiniCssExtractPlugin to compile and move my SCSS styles into a separate folder.

new MiniCssExtractPlugin({
    filename: './assets/css/[name].bundle.css',
}),

They two together also create a vendor.bundle.css I don't need at all because all of my styles are generated from SCSS files. Any way to prevent it from being generated?

sdvnksv
  • 9,350
  • 18
  • 56
  • 108

1 Answers1

1

Looks like all I needed was do a test properly:

test: /[\\/](vendor|node_modules)[\\/](?=.*\.js$)/,

So it only looked up JavaScript files.

sdvnksv
  • 9,350
  • 18
  • 56
  • 108