mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 04:09:49 +00:00
Set up grunt with tasks for:
* preen - deletes unused files from bower_components, configured in
bower.json
* concat - concatenates preened bower components, configured
automagically from the preen config
It's worth noting that this setup assumes the order of files within a
package doesn't matter. This is usually true since we often include only
one file from the package.
22 lines
533 B
JavaScript
22 lines
533 B
JavaScript
module.exports = function(grunt) {
|
|
|
|
// build the concat config from the preen config
|
|
var components = [];
|
|
for (component in grunt.file.readJSON('bower.json').preen) {
|
|
components.push('bower_components/' + component + '/**/*.js');
|
|
}
|
|
|
|
grunt.initConfig({
|
|
concat: {
|
|
components: {
|
|
src: components,
|
|
dest: 'js-deps/bower_components.js',
|
|
},
|
|
},
|
|
});
|
|
grunt.loadNpmTasks('grunt-preen');
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
|
|
grunt.registerTask('default', ['preen', 'concat']);
|
|
};
|