【问题标题】:postcss-cssnext not processing outputpostcss-cssnext 不处理输出
【发布时间】:2017-09-06 03:12:58
【问题描述】:

我正在尝试设置 postcss-cssnext 并且必须丢失一些东西,因为当我运行 npm run postcss 时,我的输出文件已创建,但它看起来像输入文件(除了一些空白差异)。我的postcss.config.js 文件正在加载,但功能未处理。我错过了什么?

postcss.config.js

var postcss = require('postcss');
var cssnext = require('postcss-cssnext');

postcss([
  cssnext({})
]);

package.json

{
  "scripts": {
    "postcss": "postcss input.css -o output.css"
  }
}

【问题讨论】:

    标签: postcss cssnext


    【解决方案1】:

    通过导出到module.exports 解决了问题

    var postcss = require('postcss');
    var cssnext = require('postcss-cssnext');
    
    module.exports = postcss([
      cssnext({})
    ]);
    

    【讨论】:

      猜你喜欢
      • 2017-11-04
      • 2017-07-29
      • 2016-06-19
      • 2019-10-29
      • 2018-04-25
      • 2017-09-13
      • 2022-10-15
      • 1970-01-01
      • 2018-10-28
      相关资源
      最近更新 更多