Gruntjs understands the syntax - <% = less than a percentage character

Below is an example of gruntjs from http://gruntjs.com/getting-started

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        src: 'src/<%= pkg.name %>.js',
        dest: 'build/<%= pkg.name %>.min.js'
      }
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');

  // Default task(s).
  grunt.registerTask('default', ['uglify']);

};

Then he mentioned:

Because the pattern lines <%%> can refer to any configuration properties, configuration data, such as file paths and file lists, can be specified in such a way as to reduce repetition.

My question is:

  • What does that mean <%= %>? Is this gruntjs syntax or is it used everywhere else? Where can I find his definition?

  • ? google/stackoverflow ( "<%=", "<%", ), .

+4
1

.

Grunt pre-ES2015. , , .

- GruntJS, . Grunt , .

, config.get . , JavaScript. grunt, - <%=grunt.template.today("yyyy")%> , . . config.get config.process .

, . , / , , ; " ", , googled .

+7

All Articles