Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript grunt sass和grunt contrib watch似乎并没有像预期的那样协同工作_Javascript_Sass_Gruntjs - Fatal编程技术网

Javascript grunt sass和grunt contrib watch似乎并没有像预期的那样协同工作

Javascript grunt sass和grunt contrib watch似乎并没有像预期的那样协同工作,javascript,sass,gruntjs,Javascript,Sass,Gruntjs,我使用grunt sass和grunt watch来编译和缩小我的代码 grunt.config('watch', { scripts: { files: ['<%= project.src.js.directory %>/*.js'], tasks: ['concat:scripts', 'uglify:compile'] }, styles: { files: [ '<%= project.src.

我使用grunt sass和grunt watch来编译和缩小我的代码

grunt.config('watch', {
    scripts: {
      files: ['<%= project.src.js.directory %>/*.js'],
      tasks: ['concat:scripts', 'uglify:compile']
    },
    styles: {
      files: [
        '<%= project.src.css.directory %>/**/*.scss'
      ],
      tasks: ['sass:compile', 'cssmin:minify']
    }
});
有关信息,my package.json如下所示:

{
  ...
  "devDependencies": {
    "grunt": "~0.4.5",
    "time-grunt": "~1.3.0",
    "load-grunt-tasks": "~3.5.0",
    "grunt-contrib-concat": "~0.5.1",
    "grunt-contrib-uglify": "~0.9.2",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-sass": "~1.1.0",
    "grunt-contrib-cssmin": "~1.0.1"
  }
}

您可以包括
sass:compile
cssmin:minify
任务吗?或者更好,你能包括你的整个Gruntfile.js吗?我添加了我的Gruntfile.js!谢谢。
{
  ...
  "devDependencies": {
    "grunt": "~0.4.5",
    "time-grunt": "~1.3.0",
    "load-grunt-tasks": "~3.5.0",
    "grunt-contrib-concat": "~0.5.1",
    "grunt-contrib-uglify": "~0.9.2",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-sass": "~1.1.0",
    "grunt-contrib-cssmin": "~1.0.1"
  }
}