73f4f64351
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.
21 lines
533 B
JavaScript
21 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']);
|
|
};
|