用grunt concat-json排除文件
我使用concat-json
来合并多个json
在一个单一的。 但是,目标src
变化,这意味着我从两个不同的path读取。 在这些path之一,我想排除一个特定的文件不包括在concat
。 在npm
文档我没有find任何相关的东西排除文件时合并。
这是我如何指定不同的目标:
grunt.initConfig({ "concat-json": { "en": { src: [ "reports/*.json" ], dest: "reports/request.json" }, "de": { //Here is where I want to merge all jsons but one in specific src: [ "reports/temp/*.json" ], dest: "reports/request.json" } } });
您可以在Grunt globbing模式中指定排除项 。
通过以下configuration, not-me.json
文件将被排除:
grunt.initConfig({ "concat-json": { "en": { src: ["reports/*.json"], dest: "reports/request.json" }, "de": { src: ["reports/temp/*.json", "!reports/temp/not-me.json"], dest: "reports/request.json" } } });