【问题标题】:use postcss-cssnext and postcss-import使用 postcss-cssnext 和 postcss-import
【发布时间】:2017-07-29 15:19:22
【问题描述】:

您好,我正在尝试在 Angular 项目中使用带有 grunt 的 postcss-import 和 postcss-cssnext。 我在 main.css 中导入了一个 colors.css 文件。

在 gruntfile 中,我首先调用 postcss-import 插件,然后调用 postcss-cssnext。但是当我同时使用这两个插件时,导入不起作用。

无论如何,如果我只调用 postcss-import 它工作正常,在 main.css 中添加 colors.css。

postcss: {
      options: {
        processors: [
          require("postcss-import")()
          require("postcss-cssnext")({browsers: ['ie >= 8', 'last 2 versions']})
        ]
      },
      server: {
        options: {
          map: true
        },
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

【问题讨论】:

    标签: angularjs gruntjs postcss postcss-import


    【解决方案1】:

    您不应将 postcss-import 与 postcss-cssnext 一起使用,因为 postcss-import 已添加到 postcss-next 的 package.json 中。

    【讨论】:

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