Autoprefixer不在CSSsnano和Postcss中使用“ grid:autoplace”

时间:2018-12-19 12:30:18

标签: webpack grid postcss autoprefixer cssnano

我们正在将postcss与cssnano和autoprefixer一起使用。我的问题是postcss在我的postcss.config.js中未使用“网格:自动放置”。

这是我的postcss.config.js:

const cssnano = require('cssnano');
const mqpacker = require('css-mqpacker');
const postcssPresetEnv = require('postcss-preset-env');

module.exports = (ctx) => ({
  map: ctx.options.map,
  parser: false,
  plugins: [
    postcssPresetEnv(),
    mqpacker({ sort: true }),
    cssnano({
      preset: [
        'advanced',
        {
          autoprefixer: {
            add: true,
            grid: 'autoplace',
          },
          reduceIdents: false,
          zindex: false,
        },
      ],
    }),
  ],
});

另一方面,当我将/* autoprefixer grid: autoplace */添加到css文件并运行时:

postcss ./dist/*.css --verbose > test.css

Postcss使用网格并添加-ms前缀。 为什么忽略配置文件中的属性?

0 个答案:

没有答案