Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt-ng-annotate all angularjs files

I want to run ng-annotate via grunt on all my project's angular files.
Could not find this option.

I only have the option annotate by specify file name.

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

I need something more generic that would run recursively on a specific directory.

like image 681
chenop Avatar asked Jul 13 '26 10:07

chenop


1 Answers

You can use the other configuration to go through folders and annotate each file which will be outputted in a *.annotated.js file.

ngAnnotate: {
    dist: {
        files: [{
                expand: true,
                src: ['**/*.js', '!**/*.annotated.js'],
                ext: '.annotated.js',
                extDot: 'last'
            }],
    }
}
like image 134
Mike Vranckx Avatar answered Jul 17 '26 19:07

Mike Vranckx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!