0

我是 grunt 的新手,我很难弄清楚我做错了什么。

当我运行它时,我收到错误“无法编译;找不到有效的源文件”。

如果有人能给我一些关于如何修复它的建议,我将不胜感激。

这是我的 gruntfile:

  module.exports = function(grunt) {

    grunt.initConfig ({
      responsive_images: {
        dev: {
          options: {
            engine: 'im',
            sizes: [{
              width: 1600,
              suffix: '_large_2x',
              quality: 30
            }]
          },
          files: [{
            expand: true,
            src: ['**/*.{gif,jpg,png};'],
            cwd: 'images_src/',
            dest: 'images/'
          }]
        }
      },
    });

    grunt.loadNpmTasks('grunt-responsive-images');
    grunt.loadNpmTasks('grunt-contrib-imagemin')
  grunt.registerTask('default', ['responsive_images']);};

这是我的 Package.json

{
  "name": "reponsive-images",
  "version": "0.1.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/udacity/responsive-images.git"
  },
  "devDependencies": {
    "grunt": "~0.4.5",
    "grunt-contrib-clean": "~0.6.0",
    "grunt-contrib-copy": "~0.8.0",
    "grunt-contrib-imagemin": "^1.0.1",
    "grunt-contrib-jshint": "~0.10.0",
    "grunt-contrib-nodeunit": "~0.4.1",
    "grunt-contrib-uglify": "~0.5.0",
    "grunt-mkdir": "~0.1.2"
  },
  "dependencies": {
    "grunt-responsive-images": "^0.1.6"
  }
}

你们可以提供的任何建议将不胜感激!

4

1 回答 1

0

我解决了!

我需要将我的 src 路径编辑为:['/**/*.{gif,jpg,png};],

于 2017-05-27T02:34:20.853 回答