angular-gettext库 - 无法编译JSON文件?

时间:2015-01-16 10:38:01

标签: json angularjs gruntjs gettext grunt-angular-gettext

我正在使用grunt-angular-gettext。

我正在尝试编译PO文件夹中存在的PO文件,并将JSON文件输出到不同的文件夹中。未生成文件夹和JSON文件。 下面是编译的grunt配置:

nggettext_compile: {
            all: {
                options: {
                    format: "json"
                },
                files: [
                    {
                        expand: true,
                        cwd:"../",
                        src: ["po/*.po"],
                        dest: '../lang/',
                        ext: ".json"
                    }
                ]
            },
        },

任何人都可以帮我配置生成JSON文件" lang"夹。 "朗"文件夹与" po"处于同一级别夹。 我如何指定目标文件夹的相对路径?

感谢。

1 个答案:

答案 0 :(得分:1)

nggettext_compile: {
            all: {
                options: {
                    format: "json"
                },
                files: [
                    {
                        expand: true,
                        cwd:"[po-loc]",
                        src: ["*.po"],
                        dest: '[dest-loc]',
                        ext: ".json"
                    }
                ]
            },
        },

将[po-loc]更改为po所在的位置
并将[dest-loc]更改为您希望JSON文件所在的位置使用完整路径,因此没有../

相关问题