angularjs - grunt-ng-注释所有 angularjs 文件

标签 angularjs grunt-contrib-uglify ng-annotate

我想通过 grunt 对我项目的所有 angular 文件运行 ng-annotate。
找不到这个选项。

我只有通过指定文件名进行注释的选项。

ngAnnotate: {
        dist: {
            files: {
                'output_file_name.js': ['input_file_name'],
            },
        }
    }

我需要更通用的东西,可以在特定目录上递归运行。

最佳答案

您可以使用其他配置浏览文件夹并注释每个文件,这些文件将在 *.annotated.js 文件中输出。

ngAnnotate: {
    dist: {
        files: [{
                expand: true,
                src: ['**/*.js', '!**/*.annotated.js'],
                ext: '.annotated.js',
                extDot: 'last'
            }],
    }
}

关于angularjs - grunt-ng-注释所有 angularjs 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32902135/

相关文章:

gruntjs - grunt-contrib-uglify 输出为空

angularjs - SystemJS 插件可以修改已经转译的文件吗?

angularjs - 跨嵌套组件绑定(bind)输出不起作用

javascript - 在没有互联网连接的嵌入式系统中使用 AngularJS

arrays - ng-repeat 完成后触发 D3 重绘

javascript - 单击 href 链接时下载文件?

javascript - 当 mangle :true is set in grunt-contrib-uglify 时,局部变量名称映射在开发工具中不起作用

node.js - 如何丑化一个文件夹中的多个.js文件并将它们输出到不同的文件夹?