0

grunt-contrib-copy配列内の各オブジェクトに同じ値を使用しています。

nonull: true, expand: true, cwd: 'src'すべてのオブジェクトを入力する必要がないようにするにはどうすればよいですか?

copy:{
      dist:{
        files: [
          {nonull: true, expand: true, cwd: 'src', src: 'index.html', dest: 'dist'},
          {nonull: true, expand: true, cwd: 'src', src: 'eanapi/**', dest: 'dist'},
        ],
      },  
    },
4

1 に答える 1

1
    // copy files
    copy: {
        img: {
            files: [{
                expand: true,
                cwd: 'src/img/',
                src: [
                    'foo/*.{png,jpg}',
                    'foo/*.{png,jpg}',
                    'foo/*.{png,jpg}',
                ],
                dest: 'img/'
            }],
        },
    },

1 つの宛先 (またはディレクトリとネストされたフォルダーをプルする) を指定している限り、次のように実行できます。

編集: nonull のデフォルトは true であるため、指定する必要はありません。

于 2016-02-23T13:49:11.540 に答える