从 grunt-autoprefixer 迁移到 grunt-postcss

migration from grunt-autoprefixer to grunt-postcss

只要grunt-autoprefixer is deprecated I want to migrate to grunt-postcss.

我在 grunt 世界(和依赖项)中还很陌生,我在文档中找不到执行迁移所需的内容。

要处理我需要三个步骤:

1- 卸载 g运行t-autoprefixer

我想我必须先 运行 npm uninstall grunt-autoprefixer --save-dev

2-安装g运行t-postcss

然后一个npm install grunt-postcss --save-dev

但完全不确定我是否必须做 npm install grunt-postcss pixrem autoprefixer-core cssnano

3- 更新配置

那我应该修改一下Gruntfile.js。所以实际上我有这个部分:

autoprefixer: {
  options: {
    browsers: ['last 1 version']
  },
  dist: {
    files: [{
      expand: true,
      cwd: '.tmp/styles/',
      src: '{,*/}*.css',
      dest: '.tmp/styles/'
    }]
  }
},

我的问题:

  1. 你能确认卸载/安装部分吗?
  2. 如何迁移配置?

写了一份迁移指南给你和以后要迁移的人,请参考:

https://github.com/nDmitry/grunt-postcss#how-to-migrate-from-grunt-autoprefixer