Created
May 15, 2017 09:15
-
-
Save matmar10/1bc359d93286a8b4bdc50aae77952c94 to your computer and use it in GitHub Desktop.
Update embark.json with bower.json dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const wiredep = require('wiredep'); | |
module.exports = function initGrunt(grunt) { | |
grunt.initConfig({ | |
embark: grunt.file.readJSON('embark.json'), | |
}); | |
grunt.registerTask('addDeps', 'Adds JS dependencies to embark config', function () { | |
const deps = wiredep(); | |
const embark = grunt.config('embark'); | |
grunt.verbose.writeln('CSS deps are:', deps.css); | |
embark.app['css/app.css'] = deps.css || []; | |
embark.app['css/app.css'].push('app/css/**'); | |
grunt.verbose.writeln('JS deps are:', deps.js); | |
embark.app['js/app.js'] = deps.js || []; | |
embark.app['js/app.js'].push('embark.js'); | |
embark.app['js/app.js'].push('app/js/**'); | |
grunt.file.write('embark.json', JSON.stringify(embark, null, 2)); | |
grunt.log.ok('Updated CSS + JS deps in embark.json'); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple Grunt script to update
embark.json
based on dependencies inbower.json