2
0

component.js 400 B

12345678910111213141516
  1. // automatically fill in component.json's script field
  2. module.exports = function (grunt) {
  3. grunt.registerTask('component', function () {
  4. var component = grunt.file.readJSON('component.json')
  5. component.scripts = []
  6. grunt.file.recurse('src', function (file) {
  7. component.scripts.push(file)
  8. })
  9. grunt.file.write('component.json', JSON.stringify(component, null, 2))
  10. })
  11. }