0

Configuration

webpack.config.js

test: /\.css$/,
exclude: /node_modules/,
use: ExtractTextPlugin.extract({
      fallback: 'style-loader',
      use: [
        {
          loader: 'css-loader',
          options: { importLoaders: 1 }
        },
        'postcss-loader'
      ]
    })

...

new ExtractTextPlugin('../css/[name].bundle.css')

postcss.config.js

module.export = {
  plugins: [
    require('autoprefixer')
  ]
}

package.json

"webpack": "^3.10.0",
"css-loader": "^0.28.9",
"style-loader": "^0.20.1",   
"extract-text-webpack-plugin": "^3.0.2",
"postcss-loader": "^2.0.10",
"autoprefixer": "^7.2.5",

Additional Info

$ node -v
v9.4.0

Issue

I get not errors, when running this configuration. It runs as if postcss-loader doesn't exist and gives me plain css. I am trying to run the basic example posted on the autoprefixer site

Carlos Rincon
  • 13
  • 1
  • 6

1 Answers1

0

webpack.config.js

test: /\.css$/,
  exclude: /node_modules/,
    use: ExtractTextPlugin.extract({
      fallback: 'style-loader',
      use: [
        'css-loader',
        {
          loader: 'postcss-loader',
          options: {
            plugins: () => [
              require('autoprefixer')
            ]
          }
        }
      ]
    })

...

new ExtractTextPlugin('/css/[name].bundle.css')
Carlos Rincon
  • 13
  • 1
  • 6