I decided to add support for prefixes for different browsers in styles. To do this, turned to the postcss-loader module, which many refer to.

Adapted the code from the documentation ( one and two ) in relation to its config. If you understand the documentation correctly, postcss.config.js optional, we can edit the webcam configuration

 let autoprefixer = require('autoprefixer'); module: { loaders: [{ test: /\.styl$/, loader: ExtractTextPlugin.extract('style', 'css!postcss!stylus?resolve url') }] }, postcss: () => { return [autoprefixer]; }, 

But the style file is compiled without prefixes. Where did I make a mistake?

    1 answer 1

    Since autoprefixer is a postcss plugin, it should be called as a function:

     return [autoprefixer()]; 
    • funny, the bundle began to gather longer, but the prefixes did not appear anyway - while1pass
    • @ while1pass did you set up the postcss-loader correctly? See how to do it for webpack 2 - kisenka
    • I have the first webpack, yes, I did it on the docks, the config is given in the question, however, for the stylus files - while1pass