1
votes

I'm currently migrating Webpack1 to the second version. As I saw here,

"Webpack is now using Postcss and cssnano in CSS-loader."

  • That means that I don't need to install postcss-loader?
  • In my old Webpack.config.js file I have this:

webpackConfig.postcss = [
  cssnano({
    autoprefixer : {
      add      : true,
      remove   : true,
      browsers : ['last 5 versions']
    },
    discardComments : {
      removeAll : true
    },
    discardUnused : false,
    mergeIdents   : false,
    reduceIdents  : false,
    safe          : true,
    sourcemap     : true
  })
];

How do I use those options in the new Webpack 2?

1

1 Answers

2
votes

You could pass in the 'mimimize' option to css-loader

...
    loader: 'css-loader',
    options: {
        minimize: true,
...