PostCSS的Grunt无法读取而不能打印文件,从文件夹“src”到“dest”

时间:2016-05-11 15:56:57

标签: gruntjs autoprefixer postcss

我安装了grunt-postcss和autoprefixer插件,但是当我尝试使用插件“load-grunt-config”,Autoprefixer和其他插​​件的metod配置PostCSS时,什么都不做,没有ifrt或错误。

这是从控制台输出的:

$ grunt postcss
Running "postcss:postcss" (postcss) task
Done.

当我以标准方式配置grunt时,PostCSS可以正常工作。

这是我的postcss.js文件,放在grunt文件夹中:

module.exports = {
  postcss: {
    options: {
      processors: [
        require('autoprefixer')(),
      ]
    },
    dist: {
      src: '<%= project.stylesheets %>/src/main.css',
      dest: '<%= project.stylesheets %>/dest/main.css'
    }
  }
};

相反,使用此命令 grunt postcss --debug ,控制台显示:

Running "postcss:postcss" (postcss) task
[D] Task source: /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-postcss/tasks/postcss.js
Done.

或者这个命令行 $ grunt postcss --verbose ,控制台显示:

$ grunt postcss --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Initializing config...OK

Registering "grunt-bowercopy" local Npm module tasks.
Reading /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-bowercopy/package.json...OK
Parsing /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-bowercopy/package.json...OK
Reading bower.json...OK
Parsing bower.json...OK
Loading "bowercopy.js" tasks...OK
+ bowercopy

Registering "grunt-contrib-sass" local Npm module tasks.
Reading /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-contrib-sass/package.json...OK
Parsing /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-contrib-sass/package.json...OK
Loading "sass.js" tasks...OK
+ sass

Registering "grunt-contrib-watch" local Npm module tasks.
Reading /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-contrib-watch/package.json...OK
Parsing /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-contrib-watch/package.json...OK
Loading "watch.js" tasks...OK
+ watch

Registering "grunt-modernizr" local Npm module tasks.
Reading /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-modernizr/package.json...OK
Parsing /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-modernizr/package.json...OK
Loading "modernizr.js" tasks...OK
+ modernizr

Registering "grunt-postcss" local Npm module tasks.
Reading /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-postcss/package.json...OK
Parsing /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-postcss/package.json...OK
Loading "postcss.js" tasks...OK
+ postcss

Registering "grunt-slim" local Npm module tasks.
Reading /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-slim/package.json...OK
Parsing /Users/mario.montalto/Progetti/start-web-site/frontend/node_modules/grunt-slim/package.json...OK
Loading "slim.js" tasks...OK
+ slim
Loading "Gruntfile.js" tasks...OK
+ default

Running tasks: postcss

Running "postcss" task

Running "postcss:postcss" (postcss) task
Verifying property postcss.postcss exists in config...OK
File: [no files]
Options: processors=[null], map, diff=false, safe=false, failOnError=false, writeDest

Done.

你不知道如何解决它

感谢您的帮助

马里奥

0 个答案:

没有答案
相关问题