Skip to content

Instantly share code, notes, and snippets.

@xcoderzach
Last active December 21, 2015 02:19
Show Gist options
  • Save xcoderzach/6234475 to your computer and use it in GitHub Desktop.
Save xcoderzach/6234475 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.registerMultiTask('write-component', 'write new files to component.json file list', function() {
var componentFile = grunt.file.readJSON('component.json')
componentFile.scripts = this.files[0].src
grunt.file.write('component.json', JSON.stringify(componentFile, null, 2))
})
grunt.initConfig({
"write-component": {
files: ["lib/**/*.js"]
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment