Navya Sharma
Navya Sharma

Reputation: 1

What can be used in place of compileType in the css-loader configuration for Webpack 5+?

I'm using Webpack 5+ and [email protected], postcss-loader @8.x but I've encountered an issue after upgrading. The compileType option, which was previously used in the css-loader configuration, is now deprecated in the latest version.

What should I use in place of compileType for global styles or "icss" styles in the Webpack 5+?

Here’s my current configuration

{ test: /.scss$/, exclude: /.module.scss$/, use: [

{
  loader: 'css-loader',
  options: {
    importLoaders: 3,
    modules: {
      compileType: 'icss', // Deprecated in Webpack 5+
    }
  }
},
{ loader: 'postcss-loader' },
'sass-loader'

] }

Upvotes: 0

Views: 13

Answers (0)

Related Questions