Make the concat list explicit
Since I decided to preen mocha and chai, we can no longer generate the concat file list from the preen config. We must instead explicitly list the modules we want to concatenate. I placed this config in bower.json so that most of the time, we won't need to change the Gruntfile. Also added a concatenation task for test page dependencies.
This commit is contained in:
parent
756fdd2383
commit
6b034e951a
6 changed files with 10922 additions and 49 deletions
16
Gruntfile.js
16
Gruntfile.js
|
@ -1,9 +1,9 @@
|
|||
module.exports = function(grunt) {
|
||||
|
||||
// build the concat config from the preen config
|
||||
var bower = grunt.file.readJSON('bower.json');
|
||||
var components = [];
|
||||
for (component in grunt.file.readJSON('bower.json').preen) {
|
||||
components.push('components/' + component + '/**/*.js');
|
||||
for (i in bower.concat.app) {
|
||||
components.push('components/' + bower.concat.app[i] + '/**/*.js');
|
||||
}
|
||||
|
||||
grunt.initConfig({
|
||||
|
@ -12,7 +12,15 @@ module.exports = function(grunt) {
|
|||
src: components,
|
||||
dest: 'js/components.js',
|
||||
},
|
||||
},
|
||||
test: {
|
||||
src: [
|
||||
'components/mocha/mocha.js',
|
||||
'components/chai/chai.js',
|
||||
'test/_test.js'
|
||||
],
|
||||
dest: 'test/test.js',
|
||||
}
|
||||
}
|
||||
});
|
||||
grunt.loadNpmTasks('grunt-preen');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue